Package: nginx
Version: 1.4.3-2
Severity: minor
--- Please enter the report below this line. ---
Hi,
In the systemd service file, the two following directive are used:
Type=forking
PIDFile=/run/nginx.pid
However, when running systemd, it's easier to let systemd handle the PID
stuff, and tell the program not to fork itself.
Moreover, we can have a situation when the user changes the PID file
location in the configuration file located at /etc/nginx/nginx.conf
Thus, I recommend removing them, and disabling nginx forking with the
directive "daemon off". See attached unit file.
It is of course opened to discussion. I tried to find any side-effect of
"daemon off", but the documentation doesn't mention any.
Have fun,
Adrien
--- System information. ---
Architecture: i386
Kernel: Linux 3.11-1-686-pae
Debian Release: jessie/sid
500 unstable ftp.fr.debian.org
1 experimental ftp.fr.debian.org
--- Package information. ---
Depends (Version) | Installed
=============================-+-=============
nginx-common (= 1.4.3-2) | 1.4.3-2
libc6 (>= 2.10) | 2.17-93
libpcre3 (>= 8.10) | 1:8.31-2
libssl1.0.0 (>= 1.0.1) | 1.0.1e-3
zlib1g (>= 1:1.1.4) | 1:1.2.8.dfsg-1
Package's Recommends field is empty.
Suggests (Version) | Installed
=========================-+-============
nginx-doc (= 1.4.3-2) |
[Unit]
Description=A high performance web server and a reverse proxy server
After=network.target
[Service]
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon off; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon off; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon off; master_process on;' -s reload
ExecStop=/usr/sbin/nginx -s quit
[Install]
WantedBy=multi-user.target