kumquat-buildroot/package/nginx/S50nginx
Matt Weber 590e9e05b6 packages: update sysv S* scripts to 644
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-02-08 11:35:22 +01:00

32 lines
584 B
Bash

#!/bin/sh
#
# Start/stop nginx
#
NGINX=/usr/sbin/nginx
PIDFILE=/var/run/nginx.pid
case "$1" in
start)
echo "Starting nginx..."
mkdir -p /var/log/nginx /var/tmp/nginx
start-stop-daemon -S -x "$NGINX" -p "$PIDFILE"
;;
stop)
echo "Stopping nginx..."
start-stop-daemon -K -x "$NGINX" -p "$PIDFILE" -o
;;
reload|force-reload)
echo "Reloading nginx configuration..."
"$NGINX" -s reload
;;
restart)
"$0" stop
sleep 1 # Prevent race condition: ensure nginx stops before start.
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac