wok-current view apache/stuff/apache @ rev 5370

Up: lguest (2.6.33.2)
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Apr 30 03:45:44 2010 +0000 (2010-04-30)
parents
children 1b6281d68d9f
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/httpd
12 OPTIONS=
13 PIDFILE=/var/run/apache/httpd.pid
15 case "$1" in
16 start)
17 if [ -f $PIDFILE ] ; 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 [ ! -f $PIDFILE ] ; 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 [ ! -f $PIDFILE ] ; 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 [ ! -f $PIDFILE ] ; 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