wok view apache/stuff/apache @ rev 18583
Up slitaz-tools-boxes(958)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Nov 12 11:40:39 2015 +0200 (2015-11-12) |
parents | 390a5a938ba6 |
children | 06c9ab3aa2fa |
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=
13 PIDFILE=/var/run/apache/httpd.pid
15 case "$1" in
16 start)
17 if active_pidfile $PIDFILE httpd ; then
18 echo "$NAME already running."
19 exit 1
20 fi
21 echo -n "Starting $DESC: $NAME... "
22 $DAEMON $OPTIONS -k start
23 status
24 ;;
25 stop)
26 if ! active_pidfile $PIDFILE httpd ; then
27 echo "$NAME is not running."
28 exit 1
29 fi
30 echo -n "Stopping $DESC: $NAME... "
31 $DAEMON $OPTION -k stop
32 rm $PIDFILE
33 status
34 ;;
35 reload)
36 if ! active_pidfile $PIDFILE httpd ; then
37 echo "$NAME is not running."
38 exit 1
39 fi
40 echo -n "Stopping $DESC: $NAME... "
41 $DAEMON $OPTION -k graceful
42 status
43 ;;
44 restart)
45 if ! active_pidfile $PIDFILE httpd ; then
46 echo "$NAME is not running."
47 exit 1
48 fi
49 echo -n "Restarting $DESC: $NAME... "
50 $DAEMON $OPTIONS -k restart
51 status
52 ;;
53 *)
54 echo ""
55 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]"
56 echo ""
57 exit 1
58 ;;
59 esac
61 exit 0