Removed the rm -rf command and replaced symlink operations by ln -sfn so that the state of tomcat can be retained \(unless somebody messes it up manually of course\)
svn path=/nixos/trunk/; revision=16757
This commit is contained in:
parent
447c1ac34a
commit
8b229a45c3
@ -109,13 +109,11 @@ mkIf config.services.tomcat.enable {
|
|||||||
stop on network-interfaces/stop
|
stop on network-interfaces/stop
|
||||||
|
|
||||||
start script
|
start script
|
||||||
rm -Rf ${cfg.baseDir}
|
|
||||||
|
|
||||||
# Create the base directory
|
# Create the base directory
|
||||||
mkdir -p ${cfg.baseDir}
|
mkdir -p ${cfg.baseDir}
|
||||||
|
|
||||||
# Create a symlink to the bin directory of the tomcat component
|
# Create a symlink to the bin directory of the tomcat component
|
||||||
ln -sf ${pkgs.tomcat6}/bin ${cfg.baseDir}/bin
|
ln -sfn ${pkgs.tomcat6}/bin ${cfg.baseDir}/bin
|
||||||
|
|
||||||
# Create a conf/ directory
|
# Create a conf/ directory
|
||||||
mkdir -p ${cfg.baseDir}/conf
|
mkdir -p ${cfg.baseDir}/conf
|
||||||
@ -124,7 +122,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
# Symlink the config files in the conf/ directory (except for catalina.properties and server.xml)
|
# Symlink the config files in the conf/ directory (except for catalina.properties and server.xml)
|
||||||
for i in $(ls ${pkgs.tomcat6}/conf | grep -v catalina.properties | grep -v server.xml)
|
for i in $(ls ${pkgs.tomcat6}/conf | grep -v catalina.properties | grep -v server.xml)
|
||||||
do
|
do
|
||||||
ln -sf ${pkgs.tomcat6}/conf/$i ${cfg.baseDir}/conf/`basename $i`
|
ln -sfn ${pkgs.tomcat6}/conf/$i ${cfg.baseDir}/conf/`basename $i`
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create a modified catalina.properties file
|
# Create a modified catalina.properties file
|
||||||
@ -163,7 +161,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
if [ -f $i ]
|
if [ -f $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a file, symlink it into the common/lib/ directory
|
# If the given web application is a file, symlink it into the common/lib/ directory
|
||||||
ln -sf $i ${cfg.baseDir}/lib/`basename $i`
|
ln -sfn $i ${cfg.baseDir}/lib/`basename $i`
|
||||||
elif [ -d $i ]
|
elif [ -d $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a directory, then iterate over the files
|
# If the given web application is a directory, then iterate over the files
|
||||||
@ -171,7 +169,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
|
|
||||||
for j in $i/lib/*
|
for j in $i/lib/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/lib/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/lib/`basename $j`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -182,7 +180,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
if [ -f $i ]
|
if [ -f $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a file, symlink it into the common/lib/ directory
|
# If the given web application is a file, symlink it into the common/lib/ directory
|
||||||
ln -sf $i ${cfg.baseDir}/shared/lib/`basename $i`
|
ln -sfn $i ${cfg.baseDir}/shared/lib/`basename $i`
|
||||||
elif [ -d $i ]
|
elif [ -d $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a directory, then iterate over the files
|
# If the given web application is a directory, then iterate over the files
|
||||||
@ -190,7 +188,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
|
|
||||||
for j in $i/shared/lib/*
|
for j in $i/shared/lib/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/shared/lib/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/shared/lib/`basename $j`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -201,7 +199,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
if [ -f $i ]
|
if [ -f $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a file, symlink it into the webapps/ directory
|
# If the given web application is a file, symlink it into the webapps/ directory
|
||||||
ln -sf $i ${cfg.baseDir}/webapps/`basename $i`
|
ln -sfn $i ${cfg.baseDir}/webapps/`basename $i`
|
||||||
elif [ -d $i ]
|
elif [ -d $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a directory, then iterate over the files
|
# If the given web application is a directory, then iterate over the files
|
||||||
@ -209,7 +207,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
|
|
||||||
for j in $i/webapps/*
|
for j in $i/webapps/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/webapps/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/webapps/`basename $j`
|
||||||
done
|
done
|
||||||
|
|
||||||
# Also symlink the configuration files if they are included
|
# Also symlink the configuration files if they are included
|
||||||
@ -217,7 +215,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
then
|
then
|
||||||
for j in $i/conf/Catalina/*
|
for j in $i/conf/Catalina/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -237,7 +235,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
if [ -f $i ]
|
if [ -f $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a file, symlink it into the webapps/ directory
|
# If the given web application is a file, symlink it into the webapps/ directory
|
||||||
ln -sf $i ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $i`
|
ln -sfn $i ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $i`
|
||||||
elif [ -d $i ]
|
elif [ -d $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a directory, then iterate over the files
|
# If the given web application is a directory, then iterate over the files
|
||||||
@ -245,7 +243,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
|
|
||||||
for j in $i/webapps/*
|
for j in $i/webapps/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $j`
|
||||||
done
|
done
|
||||||
|
|
||||||
# Also symlink the configuration files if they are included
|
# Also symlink the configuration files if they are included
|
||||||
@ -253,7 +251,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
then
|
then
|
||||||
for j in $i/conf/Catalina/*
|
for j in $i/conf/Catalina/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/conf/Catalina/${virtualHost.name}/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/conf/Catalina/${virtualHost.name}/`basename $j`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -283,7 +281,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
if [ -f $i ]
|
if [ -f $i ]
|
||||||
then
|
then
|
||||||
# If the given web service is a file, symlink it into the webapps/axis2/WEB-INF/services
|
# If the given web service is a file, symlink it into the webapps/axis2/WEB-INF/services
|
||||||
ln -sf $i ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $i`
|
ln -sfn $i ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $i`
|
||||||
elif [ -d $i ]
|
elif [ -d $i ]
|
||||||
then
|
then
|
||||||
# If the given web application is a directory, then iterate over the files
|
# If the given web application is a directory, then iterate over the files
|
||||||
@ -291,7 +289,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
|
|
||||||
for j in $i/webapps/axis2/WEB-INF/services/*
|
for j in $i/webapps/axis2/WEB-INF/services/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $j`
|
||||||
done
|
done
|
||||||
|
|
||||||
# Also symlink the configuration files if they are included
|
# Also symlink the configuration files if they are included
|
||||||
@ -299,7 +297,7 @@ mkIf config.services.tomcat.enable {
|
|||||||
then
|
then
|
||||||
for j in $i/conf/Catalina/*
|
for j in $i/conf/Catalina/*
|
||||||
do
|
do
|
||||||
ln -sf $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j`
|
ln -sfn $j ${cfg.baseDir}/conf/Catalina/localhost/`basename $j`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user