#!/bin/bash # $Header: /root/magellan-cvs/src/apache2/apache2.rc,v 1.2 2007-06-30 16:32:07 niro Exp $ #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k #%start: 60 #%stop: 80 #deps #%needs: #%before: #%after: source /etc/sysconfig/rc source $rc_functions case "$1" in start) echo -e ${COLOREDSTAR}"Starting apache2 http daemon ..." [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache start-stop-daemon --start --exec /usr/sbin/apache2 -- \ -d @@ServerRoot@@ -f /etc/apache2/httpd.conf -k start evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Stopping apache2 http daemon ..." start-stop-daemon --stop --retry -TERM/5/-KILL/5 \ --exec /usr/sbin/apache2 --pidfile /var/run/apache2.pid evaluate_retval update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; reload) echo -e ${COLOREDSTAR}"Reloading apache2 http daemon ..." start-stop-daemon --stop --oknodo --signal HUP \ --exec /usr/sbin/apache2 --pidfile /var/run/apache2.pid ;; graceful) echo -e ${COLOREDSTAR}"Gracefully restarting apache2 http daemon ..." start-stop-daemon --stop --signal USR1 \ --exec /usr/sbin/apache2 --pidfile /var/run/apache2.pid ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc /usr/sbin/apache2 ;; *) echo "Usage: $0 {start|stop|reload|graceful|restart|status}" exit 1 ;; esac