tomcat: fix service to be a daemon, and run tomcat in script rather than preStart

This commit is contained in:
Luca Bruno 2014-06-06 14:03:10 +02:00
parent 77a937beec
commit 94c2661503

View File

@ -119,6 +119,8 @@ in
startOn = "started network-interfaces"; startOn = "started network-interfaces";
stopOn = "stopping network-interfaces"; stopOn = "stopping network-interfaces";
daemonType = "daemon";
preStart = preStart =
'' ''
# Create the base directory # Create the base directory
@ -327,10 +329,12 @@ in
done done
'' ''
else ""} else ""}
${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${tomcat}/bin/startup.sh'
''; '';
script = ''
${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${tomcat}/bin/startup.sh'
'';
postStop = postStop =
'' ''
echo "Stopping tomcat..." echo "Stopping tomcat..."