package/nginx: use /var/cache/nginx instead of /var/tmp/nginx
authorPascal de Bruijn <p.debruijn@unilogic.nl>
Thu, 23 Jan 2020 08:36:41 +0000 (09:36 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 5 Jan 2021 22:32:03 +0000 (23:32 +0100)
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>
package/nginx/S50nginx
package/nginx/nginx.mk
package/nginx/nginx.service

index 964652b9224db8a9573abbbe98ee6e7a0ab0ab52..6c243f40b34553cb4b3c2c715b80faade527fbd8 100644 (file)
@@ -9,7 +9,7 @@ PIDFILE=/var/run/nginx.pid
 case "$1" in
   start)
        echo "Starting nginx..."
-       mkdir -p /var/log/nginx /var/tmp/nginx
+       mkdir -p /var/log/nginx /var/cache/nginx
        start-stop-daemon -S -x "$NGINX" -p "$PIDFILE"
        ;;
   stop)
index 00fb147682ea403c413d4c8d8fc010cdc2c8f182..fb06108ab3fab9b568eef1d63de27c0115d1846d 100644 (file)
@@ -55,11 +55,11 @@ NGINX_CONF_OPTS += \
        --group=www-data \
        --error-log-path=/var/log/nginx/error.log \
        --http-log-path=/var/log/nginx/access.log \
-       --http-client-body-temp-path=/var/tmp/nginx/client-body \
-       --http-proxy-temp-path=/var/tmp/nginx/proxy \
-       --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
-       --http-scgi-temp-path=/var/tmp/nginx/scgi \
-       --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi
+       --http-client-body-temp-path=/var/cache/nginx/client-body \
+       --http-proxy-temp-path=/var/cache/nginx/proxy \
+       --http-fastcgi-temp-path=/var/cache/nginx/fastcgi \
+       --http-scgi-temp-path=/var/cache/nginx/scgi \
+       --http-uwsgi-temp-path=/var/cache/nginx/uwsgi
 
 NGINX_CONF_OPTS += \
        $(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio) \
index f203cecdc0897cbced7805a0462eb8aaf027a23b..11ccd6223798728d8ec311b9966c7d2a01965032 100644 (file)
@@ -4,8 +4,9 @@ After=syslog.target network.target
 
 [Service]
 Type=forking
+LogsDirectory=nginx
+CacheDirectory=nginx
 PIDFile=/run/nginx.pid
-ExecStartPre=/usr/bin/mkdir -p /var/log/nginx /var/tmp/nginx
 ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
 ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
 ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload