mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
package/nginx/S50nginx: Do not assume start-stop-daemon knows -R.
start-stop-daemon fails on -R when not compiled with CONFIG_FEATURE_START_STOP_DAEMON_FANCY. Thus, do not rely on -R during stop to avoid a race condition during restart. Use a sleep 1 during restart instead, as suggested by Peter Korsgaard in <87bmluk4bm.fsf@dell.be.48ers.dk>. Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
a46bb7d9af
commit
99b8044a67
@ -14,10 +14,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo "Stopping nginx..."
|
echo "Stopping nginx..."
|
||||||
# Use -R 1 to wait for nginx to actually stop. Useful so
|
start-stop-daemon -K -x "$NGINX" -p "$PIDFILE" -o
|
||||||
# restart has no race condition. Note that BusyBox knows
|
|
||||||
# about -R but ignores it silently.
|
|
||||||
start-stop-daemon -K -x "$NGINX" -p "$PIDFILE" -R 1 -o
|
|
||||||
;;
|
;;
|
||||||
reload|force-reload)
|
reload|force-reload)
|
||||||
echo "Reloading nginx configuration..."
|
echo "Reloading nginx configuration..."
|
||||||
@ -25,6 +22,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
"$0" stop
|
"$0" stop
|
||||||
|
sleep 1 # Prevent race condition: ensure nginx stops before start.
|
||||||
"$0" start
|
"$0" start
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user