httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JAIN, ABHAY K, ATTSI" <jainab...@att.com>
Subject [users@httpd] Suggestion for apachectl
Date Mon, 29 Oct 2007 18:02:12 GMT
We have setup to gracefully shutdown/startup of Apache via init.d
on our UNIX systems. Recently we had a power outage in our lab.
It caused httpd.pid file to remain in logs directory and prevented
Apache to automatically restart upon power up.
We had to manually remove httpd.pid in each machine and start Apache.
 
I am proposing following change in start section of apachectl
to automate startup in such condition.
Please comment. How can this be incorporated in Apache.
 
case $ARGV in
start)
    if [ -r /usr/apache/logs/httpd.pid ]
    then
        # Check if apache is running
        ps -ef | grep `cat /usr/apache/logs/httpd.pid` | grep -v grep >
/dev/null 2>&1
        if [ $? -ne 0 ]
        then
                # Probably system was not shutdown properly
                rm -f /usr/apache/logs/httpd.pid
        fi
    fi
    $HTTPD -k $ARGV
    ERROR=$?
    ;;
 
Abhay

Mime
View raw message