This may seem to be a repeated question but it is not. I found some articles on it where start-stop-daemon
doesn't create a PID file. But in my case, I have already created the PID file. I execute this command on my server to start Nginx:
/mnt/nginx/logs/nginx.pid
start-stop-daemon --start --quiet --pidfile /mnt/nginx/logs/nginx.pid --exec /usr/local/sbin/nginx
The PID file is already present but still the start-stop-daemon
doesn't write to the file. I even tried to use the --make-pidfile
option but then the start-stop-daemon
writes wrong pid to the file.