2012-09-17 25 views
6

Bu tekrarlanan bir soru gibi görünebilir ama değil. Üzerinde start-stop-daemon bir PID dosyası oluşturmadığı bazı makaleler buldum. Ama benim durumumda, PID dosyasını zaten oluşturdum.start-stop-daemon dosya mevcut olsa bile nginx.pid dosyasına yazmaz

/mnt/nginx/logs/nginx.pid 
start-stop-daemon --start --quiet --pidfile /mnt/nginx/logs/nginx.pid --exec /usr/local/sbin/nginx 

PID dosyası zaten mevcut ancak yine start-stop-daemon dosyaya yazmaz: Ben Nginx başlatmak için benim sunucuda bu komutu yürütün. Hatta --make-pidfile seçeneğini kullanmayı denedim, ancak start-stop-daemon dosyaya yanlış pid yazıyor.

cevap

7

--make-pidfile seçeneği gereklidir. start-stop-daemon'un nedeni, "yanlış posta" yazısının nginx çatal olduğunu yazmaktadır. Bu start-stop-daemon adam sayfasında not edilir:

-m, --make-pidfile 
      Used when starting a program that does not create its own pid 
      file. This option will make start-stop-daemon create the file 
      referenced with --pidfile and place the pid into it just before 
      executing the process. Note, the file will not be removed when 
      stopping the program. NOTE: This feature may not work in all 
      cases. Most notably when the program being executed forks from 
      its main process. Because of this, it is usually only useful 
      when combined with the --background option. 

(çatallanmasını yeniden bölümünü bakınız.)

Böyle kendi pid dosyası oluşturmak için nginx alma gibi farklı bir çözüm kullanmak gerekir.

+0

'nginx''i kendi dosyasını oluşturmak için: http://wiki.nginx.org/CoreModule#pid. Temel olarak pid yönergesini nginx.conf dosyanıza eklemeniz yeterlidir. – Such

İlgili konular