Summary: packaging updates

Empty paths lead to unpleasant surpises later on

Use basename to find the pid file when stopping tomcat
This commit is contained in:
Hugo Trippaers 2013-02-05 15:04:58 +01:00
parent 0ff6612f7f
commit 0cc4636a2d
2 changed files with 6 additions and 6 deletions

View File

@ -46,8 +46,8 @@ NAME="$(basename $0)"
stop() { stop() {
SHUTDOWN_WAIT="30" SHUTDOWN_WAIT="30"
count="0" count="0"
if [ -f /var/run/cloud-management.pid ]; then if [ -f /var/run/${NAME}.pid ]; then
pid=`cat /var/run/cloud-management.pid` pid=`cat /var/run/${NAME}.pid`
kill $pid &>/dev/null kill $pid &>/dev/null
until [ "$(ps --pid $pid | grep -c $pid)" -eq "0" ] || \ until [ "$(ps --pid $pid | grep -c $pid)" -eq "0" ] || \
[ "$count" -gt "$SHUTDOWN_WAIT" ] [ "$count" -gt "$SHUTDOWN_WAIT" ]
@ -78,8 +78,8 @@ set_ulimit() {
handle_pid_file() { handle_pid_file() {
if [ "$1" -ne 0 ] ; then if [ "$1" -ne 0 ] ; then
echo "The pid file locates at /var/run/cloud-management.pid and lock file at /var/lock/subsys/cloud-management. echo "The pid file locates at /var/run/${NAME}.pid and lock file at /var/lock/subsys/${NAME}.
Starting cloud-management will take care of them or you can manually clean up." Starting ${NAME} will take care of them or you can manually clean up."
fi fi
} }

View File

@ -48,8 +48,8 @@ MSLOGDIR=/var/log/cloudstack/management/
MSMNTDIR=/var/lib/cloud/mnt MSMNTDIR=/var/lib/cloud/mnt
MSUSER=cloud MSUSER=cloud
PIDDIR=/var/run PIDDIR=/var/run
PLUGINJAVADIR= PLUGINJAVADIR=/usr/share/cloudstack-management/plugin
PREMIUMJAVADIR= PREMIUMJAVADIR=/usr/share/cloudstack-management/premium
PYTHONDIR=/usr/lib/python2.6/site-packages/ PYTHONDIR=/usr/lib/python2.6/site-packages/
SERVERSYSCONFDIR=/etc/sysconfig SERVERSYSCONFDIR=/etc/sysconfig
SETUPDATADIR=/usr/share/cloudstack-management/setup SETUPDATADIR=/usr/share/cloudstack-management/setup