Return-Path: Delivered-To: apmail-httpd-bugs-archive@www.apache.org Received: (qmail 83051 invoked from network); 6 Sep 2003 19:28:55 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Sep 2003 19:28:55 -0000 Received: (qmail 98020 invoked by uid 500); 6 Sep 2003 19:28:41 -0000 Delivered-To: apmail-httpd-bugs-archive@httpd.apache.org Received: (qmail 97986 invoked by uid 500); 6 Sep 2003 19:28:40 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: "Apache HTTPD Bugs Notification List" Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 97966 invoked from network); 6 Sep 2003 19:28:40 -0000 Received: from unknown (HELO exchange.sun.com) (192.18.33.10) by daedalus.apache.org with SMTP; 6 Sep 2003 19:28:40 -0000 Received: (qmail 21572 invoked by uid 50); 6 Sep 2003 19:30:40 -0000 Date: 6 Sep 2003 19:30:40 -0000 Message-ID: <20030906193040.21571.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: bugs@httpd.apache.org Cc: Subject: DO NOT REPLY [Bug 22960] New: - Problem with pid file when restarting chrooted Apache after a power outage. X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22960 Problem with pid file when restarting chrooted Apache after a power outage. Summary: Problem with pid file when restarting chrooted Apache after a power outage. Product: Apache httpd-2.0 Version: 2.0.44 Platform: PC OS/Version: Linux Status: NEW Severity: Normal Priority: Other Component: support AssignedTo: bugs@httpd.apache.org ReportedBy: david@megapico.co.uk Problem with pid file when restarting Apache after a power outage. I found a problem with restarting Apache after a power outage. Apache is running in a chroot, but I'm not sure if that is critical. A few additional lines in apachectl solve this problem, as explained below. The pid file for httpd was not removed when power to the server was cut, so httpd found the pid file on start-up and would not start a new httpd process. It is necessary to check using apachectl that if a pid file exists, it really belongs to a running httpd. If it does not, then it can be safely removed, allowing a new copy of httpd to be started. When specifying the location of the pid file in apachectl it is important to specify it relative to the root of the file system, not the root of any chroot that apache is to run in. Having to specify the pid location reverts to Apache 1.3 format, rather than finding the info from the config files, but whereever it is specified, the need to take account of chroot will still exist. This looks similar to bug 14647. ------------------------------------------------- Required changes to apachectl to fix this: Add to CONFIGURATION SECTION: # the path to your PID file, prior to chroot set-up, if any PIDFILE=/chroot/apache2/usr/local/apache/logs/httpd.pid Add before "case $ARGV in": #Check that an old PID file in chroot has got left after power outage etc. #If a PID file exists, check it points to a running httpd if [ -f $PIDFILE ] ; then PID=`cat $PIDFILE` PIDPROC=`ps -p $PID -o comm --no-headers 2>/dev/null` if [ "x$PID" != "x" ] && [ "x$PIDPROC" != "xhttpd" ] ; then #pid points to a valid process, but it is not httpd rm $PIDFILE 2>/dev/null fi fi --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org