wok annotate apache/stuff/apache @ rev 13673
get-skype: new tarball,depends
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Sun Nov 25 03:41:58 2012 +0000 (2012-11-25) |
parents | 00c9a8ae56b4 |
children | 390a5a938ba6 |
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" |
erjo@4108 | 11 DAEMON=/usr/bin/httpd |
erjo@4108 | 12 OPTIONS= |
erjo@4108 | 13 PIDFILE=/var/run/apache/httpd.pid |
erjo@4108 | 14 |
erjo@4108 | 15 case "$1" in |
erjo@4108 | 16 start) |
pascal@6170 | 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@6170 | 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@6170 | 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@6170 | 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 |