From e39b10a4d92cb4c0c0957ba071879135d44b4eb0 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Mon, 1 Nov 2010 19:01:26 +0000 Subject: [PATCH] - The Disnix service needs Nix in its PATH for now - Implemented an extraGroups property for tomcat to grant a tomcat application access to the Disnix service svn path=/nixos/trunk/; revision=24561 --- modules/services/misc/disnix.nix | 4 ++++ modules/services/web-servers/tomcat.nix | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/modules/services/misc/disnix.nix b/modules/services/misc/disnix.nix index 3688f8c3fc71..abf664c90314 100644 --- a/modules/services/misc/disnix.nix +++ b/modules/services/misc/disnix.nix @@ -49,6 +49,7 @@ in services.dbus.packages = [ pkgs.disnix ]; services.tomcat.enable = cfg.useWebServiceInterface; + services.tomcat.extraGroups = [ "disnix" ]; services.tomcat.javaOpts = "${optionalString cfg.useWebServiceInterface "-Djava.library.path=${pkgs.libmatthew_java}/lib/jni"} "; services.tomcat.sharedLibs = [] ++ optional cfg.useWebServiceInterface "${pkgs.DisnixWebService}/share/java/DisnixConnection.jar" @@ -67,6 +68,9 @@ in script = '' + export PATH=/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin + export HOME=/root + ${pkgs.disnix}/bin/disnix-service --activation-modules-dir=${disnix_activation_scripts}/libexec/disnix/activation-scripts ''; }; diff --git a/modules/services/web-servers/tomcat.nix b/modules/services/web-servers/tomcat.nix index e63abfb15d27..83b95655011b 100644 --- a/modules/services/web-servers/tomcat.nix +++ b/modules/services/web-servers/tomcat.nix @@ -26,6 +26,12 @@ in description = "Location where Tomcat stores configuration files, webapplications and logfiles"; }; + extraGroups = mkOption { + default = []; + example = [ "users" ]; + description = "Defines extra groups to which the tomcat user belongs."; + }; + user = mkOption { default = "tomcat"; description = "User account under which Apache Tomcat runs."; @@ -104,6 +110,7 @@ in uid = config.ids.uids.tomcat; description = "Tomcat user"; home = "/homeless-shelter"; + extraGroups = cfg.extraGroups; }; jobs.tomcat =