微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

即使文件存在,start-stop-daemon也不会写入nginx.pid文件

这似乎是一个重复的问题,但事实并非如此。 我发现了一些文章,其中start-stop-daemon不会创build一个PID文件。 但在我的情况下,我已经创build了PID文件。 我在我的服务器上执行这个命令来启动Nginx

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

PID文件已经存在,但是start-stop-daemon仍然不写入文件。 我甚至尝试使用--make-pidfile选项,但是随后start-stop-daemon将错误的pid写入文件

Rails 3 + carrierwave + Nginx =权限被拒绝

Longpolling对服务器的影响

使用Nginx服务angular度应用

如何解码“内容编码:gzip,gzip”使用curl?

将RoR部署到AWS Beanstalk时发生Nginx错误

--make-pidfile选项是必需的。 start-stop-daemon写入“错误的pid”的原因是Nginx分叉。 这在start-stop-daemon手册页中注明:

-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.

(请参阅重新分类。)

你需要使用不同的解决方案,比如让Nginx创建自己的pid文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐