mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
31
package/nginx/S50nginx
Normal file
31
package/nginx/S50nginx
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user