From 8ffb70f8322a48c902bdd76069c3957290dab7f6 Mon Sep 17 00:00:00 2001 From: Leigh B Stoller Date: Wed, 6 Feb 2013 12:52:55 -0700 Subject: [PATCH] Fixes for apache22 ... --- sysadmin/apachelogroll.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sysadmin/apachelogroll.sh b/sysadmin/apachelogroll.sh index 2d2b0a007..59580533b 100755 --- a/sysadmin/apachelogroll.sh +++ b/sysadmin/apachelogroll.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2001-2006 University of Utah and the Flux Group. +# Copyright (c) 2001-2013 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -24,6 +24,7 @@ # CONSTANTS INIT PIDFILE=/var/run/apache.pid +ALTPIDFILE=/var/run/httpd.pid LOGDIR=/usr/testbed/log DESTDIR=/z/testbed/logs/apache APACHECTL=/usr/local/sbin/apachectl @@ -70,11 +71,20 @@ done # if [ $MOVED -eq 1 ] then + mypid="" + if [ -e $PIDFILE ] + then + mypid=`cat $PIDFILE` + elif [ -e $ALTPIDFILE ] + then + mypid=`cat $ALTPIDFILE` + fi + # Should be a proc entry if the process is running! # Note that a graceful restart waits for all clients to disconnect. - if [ -e /proc/`cat $PIDFILE` ] + if [ "x$mypid" != "x" -a -e "/proc/$mypid" ] then - $APACHECTL graceful + $APACHECTL restart if [ $? -ne 0 ] then echo "Apache restart failed" -- 2.22.0