Skip to content

Instantly share code, notes, and snippets.

@hostmaster
Created June 4, 2014 13:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hostmaster/f92a6f5edc3870ccc6ac to your computer and use it in GitHub Desktop.
start-stop-daemon nginx issue
[root@dev:~]# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
[root@dev:~]# cat /var/run/nginx.pid
23616
[root@dev:~]# pgrep nginx
23616
23617
23618
23619
23620
[root@dev:~]# cat /var/log/nginx/error.log
[root@dev:~]# start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/nginx.pid --name nginx
[root@dev:~]# cat /var/log/nginx/error.log
2014/06/04 13:07:17 [debug] 24028#0: epoll add event: fd:7 op:1 ev:00002001
[root@dev:~]# pgrep nginx
23616
24028
[root@dev:~]# ps ax | grep nginx
23616 ? Ss 0:00 nginx: master process /usr/sbin/nginx
24028 ? S 0:00 nginx: worker process
[root@dev:~]# cat /var/log/nginx/error.log
2014/06/04 13:07:17 [debug] 24028#0: epoll add event: fd:7 op:1 ev:00002001
[root@dev:~]# cat /var/run/nginx.pid
cat: /var/run/nginx.pid: No such file or directory
@hostmaster
Copy link
Author

nginx starts at installation time with a default configuration file, ansible deploys a new configuration file with different pid file path and reduced amount of workers. nginx can't handle a pid_file change properly

http://jpetazzo.github.io/2013/10/06/policy-rc-d-do-not-start-services-automatically/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment