wok annotate nginx/stuff/etc/init.d/nginx @ rev 25503
f3: include extra programs
author | Hans-G?nter Theisgen |
---|---|
date | Fri Jan 27 10:37:43 2023 +0100 (17 months ago) |
parents | 7f188676b59c |
children |
rev | line source |
---|---|
pascal@10450 | 1 #!/bin/sh |
al@19159 | 2 # /etc/init.d/nginx: Start, stop and restart web server on SliTaz, |
pascal@10450 | 3 # at boot time or with the command line. Daemons options are configured |
pascal@10450 | 4 # with /etc/daemons.conf |
pascal@10450 | 5 # |
pascal@10450 | 6 . /etc/init.d/rc.functions |
pascal@10450 | 7 . /etc/daemons.conf |
pascal@10450 | 8 |
pascal@10450 | 9 NAME=Nginx |
al@19159 | 10 DESC="$(_ 'web server')" |
pascal@10450 | 11 DAEMON=/usr/sbin/nginx |
pascal@10450 | 12 OPTIONS=$NGINX_OPTIONS |
pascal@10450 | 13 PIDFILE=/var/run/nginx.pid |
pascal@10450 | 14 |
pascal@10450 | 15 case "$1" in |
Hans-G?nter@24995 | 16 (start) |
Hans-G?nter@24995 | 17 if active_pidfile $PIDFILE nginx |
Hans-G?nter@24995 | 18 then |
Hans-G?nter@24995 | 19 _ '%s is already running.' $NAME |
Hans-G?nter@24995 | 20 exit 1 |
Hans-G?nter@24995 | 21 fi |
Hans-G?nter@24995 | 22 newline |
Hans-G?nter@24995 | 23 action 'Starting %s: %s...' "$DESC" $NAME |
Hans-G?nter@24995 | 24 $DAEMON $OPTIONS |
Hans-G?nter@24995 | 25 status |
Hans-G?nter@24995 | 26 ;; |
Hans-G?nter@24995 | 27 (stop) |
Hans-G?nter@24995 | 28 if ! active_pidfile $PIDFILE nginx |
Hans-G?nter@24995 | 29 then |
Hans-G?nter@24995 | 30 _ '%s is not running.' $NAME |
Hans-G?nter@24995 | 31 exit 1 |
Hans-G?nter@24995 | 32 fi |
Hans-G?nter@24995 | 33 action 'Stopping %s: %s...' "$DESC" $NAME |
Hans-G?nter@24995 | 34 kill $(cat $PIDFILE) |
Hans-G?nter@24995 | 35 status |
Hans-G?nter@24995 | 36 ;; |
Hans-G?nter@24995 | 37 (restart) |
Hans-G?nter@24995 | 38 if ! active_pidfile $PIDFILE nginx |
Hans-G?nter@24995 | 39 then |
Hans-G?nter@24995 | 40 _ '%s is not running.' $NAME |
Hans-G?nter@24995 | 41 exit 1 |
Hans-G?nter@24995 | 42 fi |
Hans-G?nter@24995 | 43 action 'Restarting %s: %s...' "$DESC" $NAME |
Hans-G?nter@24995 | 44 kill $(cat $PIDFILE) |
Hans-G?nter@24995 | 45 sleep 2 |
Hans-G?nter@24995 | 46 $DAEMON $OPTIONS |
Hans-G?nter@24995 | 47 status |
Hans-G?nter@24995 | 48 ;; |
Hans-G?nter@24995 | 49 (*) |
Hans-G?nter@24995 | 50 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" |
Hans-G?nter@24995 | 51 newline |
Hans-G?nter@24995 | 52 exit 1 |
Hans-G?nter@24995 | 53 ;; |
pascal@10450 | 54 esac |
pascal@10450 | 55 |
pascal@10450 | 56 exit 0 |