wok view apache/stuff/apache @ rev 19334

apache: mkdir for PIDFILE
author Richard Dunbar <mojo@slitaz.org>
date Sun Jul 17 20:43:11 2016 -0400 (2016-07-17)
parents 8ed3403d8a9e
children
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/httpd.pid
15 [ -d /var/run/apache ] || mkdir -p /var/run/apache
17 case "$1" in
18 start)
19 if active_pidfile $PIDFILE httpd ; then
20 _ '%s is already running.' $NAME
21 exit 1
22 fi
23 action 'Starting %s: %s...' "$DESC" $NAME
24 $DAEMON $OPTIONS -k start
25 status
26 ;;
27 stop)
28 if ! active_pidfile $PIDFILE httpd ; then
29 _ '%s is not running.' $NAME
30 exit 1
31 fi
32 action 'Stopping %s: %s...' "$DESC" $NAME
33 $DAEMON $OPTIONS -k stop
34 rm $PIDFILE
35 status
36 ;;
37 reload)
38 if ! active_pidfile $PIDFILE httpd ; then
39 _ '%s is not running.' $NAME
40 exit 1
41 fi
42 action 'Stopping %s: %s...' "$DESC" $NAME
43 $DAEMON $OPTIONS -k graceful
44 status
45 ;;
46 restart)
47 if ! active_pidfile $PIDFILE httpd ; then
48 _ '%s is not running.' $NAME
49 exit 1
50 fi
51 action 'Restarting %s: %s...' "$DESC" $NAME
52 $DAEMON $OPTIONS -k restart
53 status
54 ;;
55 *)
56 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|reload|restart]"
57 newline
58 exit 1
59 ;;
60 esac
62 exit 0