![Pascal de Bruijn](/assets/img/avatar_default.png)
move http-client-body-temp-path http-proxy-temp-path http-fastcgi-temp-path http-scgi-temp-path http-uwsgi-temp-path from /var/tmp/nginx to /var/cache/nginx this allows the use of systemd constructs LogsDirectory=nginx CacheDirectory=nginx to replace ExecStartPre=/usr/bin/mkdir -p /var/log/nginx /var/tmp/nginx as there isn't a similar construct for /var/tmp. Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
32 lines
586 B
Bash
32 lines
586 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/cache/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
|