Added some more features to the tomcat service
svn path=/nixos/trunk/; revision=12284
This commit is contained in:
parent
82ddadc27c
commit
6a2600c0a2
@ -1459,6 +1459,16 @@
|
|||||||
default = "";
|
default = "";
|
||||||
description = "Location where webapplications are stored. Leave empty to use the baseDir.";
|
description = "Location where webapplications are stored. Leave empty to use the baseDir.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
javaOpts = mkOption {
|
||||||
|
default = "";
|
||||||
|
description = "Parameters to pass to the Java Virtual Machine which spawns Apache Tomcat";
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedLibFrom = mkOption {
|
||||||
|
default = "";
|
||||||
|
description ="Location where shared libraries are stored. Leave empty to use the baseDir.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
disnix = {
|
disnix = {
|
||||||
|
@ -33,6 +33,7 @@ in
|
|||||||
if ! test -d ${cfg.baseDir}
|
if ! test -d ${cfg.baseDir}
|
||||||
then
|
then
|
||||||
mkdir -p ${cfg.baseDir}/webapps
|
mkdir -p ${cfg.baseDir}/webapps
|
||||||
|
mkdir -p ${cfg.baseDir}/shared
|
||||||
cp -av ${pkgs.tomcat6}/{conf,temp,logs} ${cfg.baseDir}
|
cp -av ${pkgs.tomcat6}/{conf,temp,logs} ${cfg.baseDir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -61,9 +62,18 @@ in
|
|||||||
do
|
do
|
||||||
chmod -v 644 $i
|
chmod -v 644 $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Deploy all shared libraries
|
||||||
|
|
||||||
|
if ! test "${cfg.sharedLibFrom}" = ""
|
||||||
|
then
|
||||||
|
rm -f ${cfg.baseDir}/shared/lib
|
||||||
|
ln -s ${cfg.sharedLibFrom} ${cfg.baseDir}/shared/lib
|
||||||
|
fi
|
||||||
|
|
||||||
end script
|
end script
|
||||||
|
|
||||||
respawn ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} ${pkgs.tomcat6}/bin/startup.sh; sleep 1d'
|
respawn ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} JAVA_OPTS="${cfg.javaOpts}" ${pkgs.tomcat6}/bin/startup.sh; sleep 1d'
|
||||||
|
|
||||||
stop script
|
stop script
|
||||||
echo "Stopping tomcat..."
|
echo "Stopping tomcat..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user