wok annotate apache/stuff/apache @ rev 19159
/etc/init.d/*: use 'action' in pair with 'status'.
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu May 26 20:16:45 2016 +0300 (2016-05-26) |
parents | 06c9ab3aa2fa |
children | 8ed3403d8a9e |
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 |
pascal@18179 | 13 PIDFILE=/var/run/apache/httpd.pid |
erjo@4108 | 14 |
erjo@4108 | 15 case "$1" in |
erjo@4108 | 16 start) |
pascal@18179 | 17 if active_pidfile $PIDFILE httpd ; then |
al@19159 | 18 _ '%s is already running.' $NAME |
erjo@4108 | 19 exit 1 |
erjo@4108 | 20 fi |
al@19159 | 21 action 'Starting %s: %s...' "$DESC" $NAME |
al@19159 | 22 $DAEMON $OPTIONS -k start |
erjo@4108 | 23 status |
erjo@4108 | 24 ;; |
erjo@4108 | 25 stop) |
pascal@18179 | 26 if ! active_pidfile $PIDFILE httpd ; then |
al@19159 | 27 _ '%s is not running.' $NAME |
erjo@4108 | 28 exit 1 |
erjo@4108 | 29 fi |
al@19159 | 30 action 'Stopping %s: %s...' "$DESC" $NAME |
pascal@18591 | 31 $DAEMON $OPTIONS -k stop |
erjo@4108 | 32 rm $PIDFILE |
erjo@4108 | 33 status |
erjo@4108 | 34 ;; |
erjo@4108 | 35 reload) |
pascal@18179 | 36 if ! active_pidfile $PIDFILE httpd ; then |
al@19159 | 37 _ '%s is not running.' $NAME |
erjo@4108 | 38 exit 1 |
erjo@4108 | 39 fi |
al@19159 | 40 action 'Stopping %s: %s...' "$DESC" $NAME |
pascal@18591 | 41 $DAEMON $OPTIONS -k graceful |
erjo@4108 | 42 status |
erjo@4108 | 43 ;; |
erjo@4108 | 44 restart) |
pascal@18179 | 45 if ! active_pidfile $PIDFILE httpd ; then |
al@19159 | 46 _ '%s is not running.' $NAME |
erjo@4108 | 47 exit 1 |
erjo@4108 | 48 fi |
al@19159 | 49 action 'Restarting %s: %s...' "$DESC" $NAME |
erjo@4108 | 50 $DAEMON $OPTIONS -k restart |
erjo@4108 | 51 status |
erjo@4108 | 52 ;; |
erjo@4108 | 53 *) |
al@19159 | 54 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|reload|restart]" |
al@19159 | 55 newline |
erjo@4108 | 56 exit 1 |
erjo@4108 | 57 ;; |
erjo@4108 | 58 esac |
erjo@4108 | 59 |
erjo@4108 | 60 exit 0 |