wok annotate apache/stuff/apache @ rev 21937

Up nnn (2.7)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 07 18:30:01 2019 +0200 (2019-10-07)
parents 8ed3403d8a9e
children
rev   line source
erjo@4108 1 #!/bin/sh
al@19159 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
al@19159 10 DESC="$(_ 'Apache Web Server')"
pascal@18179 11 DAEMON=/usr/bin/apachectl
pascal@18591 12 OPTIONS=$APACHE_OPTIONS
mojo@19334 13 PIDFILE=/var/run/apache/httpd.pid
mojo@19334 14
mojo@19334 15 [ -d /var/run/apache ] || mkdir -p /var/run/apache
erjo@4108 16
erjo@4108 17 case "$1" in
erjo@4108 18 start)
pascal@18179 19 if active_pidfile $PIDFILE httpd ; then
al@19159 20 _ '%s is already running.' $NAME
erjo@4108 21 exit 1
erjo@4108 22 fi
al@19159 23 action 'Starting %s: %s...' "$DESC" $NAME
al@19159 24 $DAEMON $OPTIONS -k start
erjo@4108 25 status
erjo@4108 26 ;;
erjo@4108 27 stop)
pascal@18179 28 if ! active_pidfile $PIDFILE httpd ; then
al@19159 29 _ '%s is not running.' $NAME
erjo@4108 30 exit 1
erjo@4108 31 fi
al@19159 32 action 'Stopping %s: %s...' "$DESC" $NAME
pascal@18591 33 $DAEMON $OPTIONS -k stop
erjo@4108 34 rm $PIDFILE
erjo@4108 35 status
erjo@4108 36 ;;
erjo@4108 37 reload)
pascal@18179 38 if ! active_pidfile $PIDFILE httpd ; then
al@19159 39 _ '%s is not running.' $NAME
erjo@4108 40 exit 1
erjo@4108 41 fi
al@19159 42 action 'Stopping %s: %s...' "$DESC" $NAME
pascal@18591 43 $DAEMON $OPTIONS -k graceful
erjo@4108 44 status
erjo@4108 45 ;;
erjo@4108 46 restart)
pascal@18179 47 if ! active_pidfile $PIDFILE httpd ; then
al@19159 48 _ '%s is not running.' $NAME
erjo@4108 49 exit 1
erjo@4108 50 fi
al@19159 51 action 'Restarting %s: %s...' "$DESC" $NAME
erjo@4108 52 $DAEMON $OPTIONS -k restart
erjo@4108 53 status
erjo@4108 54 ;;
erjo@4108 55 *)
al@19159 56 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|reload|restart]"
al@19159 57 newline
erjo@4108 58 exit 1
erjo@4108 59 ;;
erjo@4108 60 esac
erjo@4108 61
erjo@4108 62 exit 0