wok view apache/stuff/apache @ rev 19321

apache: update PIDFILE
author Richard Dunbar <mojo@slitaz.org>
date Wed Jul 13 20:20:01 2016 -0400 (2016-07-13)
parents 7f188676b59c
children 075a1be356a3
line source
1 #!/bin/sh
2 # /etc/init.d/apache: Start, stop and restart Apache web server on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=Apache
10 DESC="$(_ 'Apache Web Server')"
11 DAEMON=/usr/bin/apachectl
12 OPTIONS=$APACHE_OPTIONS
13 PIDFILE=/var/run/apache.pid
15 case "$1" in
16 start)
17 if active_pidfile $PIDFILE httpd ; then
18 _ '%s is already running.' $NAME
19 exit 1
20 fi
21 action 'Starting %s: %s...' "$DESC" $NAME
22 $DAEMON $OPTIONS -k start
23 status
24 ;;
25 stop)
26 if ! active_pidfile $PIDFILE httpd ; then
27 _ '%s is not running.' $NAME
28 exit 1
29 fi
30 action 'Stopping %s: %s...' "$DESC" $NAME
31 $DAEMON $OPTIONS -k stop
32 rm $PIDFILE
33 status
34 ;;
35 reload)
36 if ! active_pidfile $PIDFILE httpd ; then
37 _ '%s is not running.' $NAME
38 exit 1
39 fi
40 action 'Stopping %s: %s...' "$DESC" $NAME
41 $DAEMON $OPTIONS -k graceful
42 status
43 ;;
44 restart)
45 if ! active_pidfile $PIDFILE httpd ; then
46 _ '%s is not running.' $NAME
47 exit 1
48 fi
49 action 'Restarting %s: %s...' "$DESC" $NAME
50 $DAEMON $OPTIONS -k restart
51 status
52 ;;
53 *)
54 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|reload|restart]"
55 newline
56 exit 1
57 ;;
58 esac
60 exit 0