wok annotate apache/stuff/apache @ rev 18179

Apache: fix init script
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 05 12:26:54 2015 +0200 (2015-07-05)
parents 390a5a938ba6
children 06c9ab3aa2fa
rev   line source
erjo@4108 1 #!/bin/sh
erjo@4108 2 # /etc/init.d/apache: Start, stop and restart Apache web server on SliTaz,
erjo@4108 3 # at boot time or with the command line. Daemons options are configured
erjo@4108 4 # with /etc/daemons.conf
erjo@4108 5 #
erjo@4108 6 . /etc/init.d/rc.functions
erjo@4108 7 . /etc/daemons.conf
erjo@4108 8
erjo@4108 9 NAME=Apache
erjo@4108 10 DESC="Apache Web Server"
pascal@18179 11 DAEMON=/usr/bin/apachectl
erjo@4108 12 OPTIONS=
pascal@18179 13 PIDFILE=/var/run/apache/httpd.pid
erjo@4108 14
erjo@4108 15 case "$1" in
erjo@4108 16 start)
pascal@18179 17 if active_pidfile $PIDFILE httpd ; then
erjo@4108 18 echo "$NAME already running."
erjo@4108 19 exit 1
erjo@4108 20 fi
erjo@4108 21 echo -n "Starting $DESC: $NAME... "
erjo@4108 22 $DAEMON $OPTIONS -k start
erjo@4108 23 status
erjo@4108 24 ;;
erjo@4108 25 stop)
pascal@18179 26 if ! active_pidfile $PIDFILE httpd ; then
erjo@4108 27 echo "$NAME is not running."
erjo@4108 28 exit 1
erjo@4108 29 fi
erjo@4108 30 echo -n "Stopping $DESC: $NAME... "
erjo@4108 31 $DAEMON $OPTION -k stop
erjo@4108 32 rm $PIDFILE
erjo@4108 33 status
erjo@4108 34 ;;
erjo@4108 35 reload)
pascal@18179 36 if ! active_pidfile $PIDFILE httpd ; then
erjo@4108 37 echo "$NAME is not running."
erjo@4108 38 exit 1
erjo@4108 39 fi
erjo@4108 40 echo -n "Stopping $DESC: $NAME... "
erjo@4108 41 $DAEMON $OPTION -k graceful
erjo@4108 42 status
erjo@4108 43 ;;
erjo@4108 44 restart)
pascal@18179 45 if ! active_pidfile $PIDFILE httpd ; then
erjo@4108 46 echo "$NAME is not running."
erjo@4108 47 exit 1
erjo@4108 48 fi
erjo@4108 49 echo -n "Restarting $DESC: $NAME... "
erjo@4108 50 $DAEMON $OPTIONS -k restart
erjo@4108 51 status
erjo@4108 52 ;;
erjo@4108 53 *)
erjo@4108 54 echo ""
erjo@4108 55 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]"
erjo@4108 56 echo ""
erjo@4108 57 exit 1
erjo@4108 58 ;;
erjo@4108 59 esac
erjo@4108 60
erjo@4108 61 exit 0