小编Thi*_*ank的帖子

为 PHP 服务器使用 start-stop-daemon

我正在开发用 PHP 编写的套接字服务器。这部分工作已经完成,但现在我需要将它作为守护进程运行。

为此,我尝试使用start-stop-daemon但它不起作用。我的服务器正在运行 Debian。

为简化起见,我的问题是为什么以下命令不运行我的守护程序或如何调试它?

start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/server-ticket.pid --exec /usr/local/zend/bin/php /var/www/server/consultpilot/ServerTicket.php >> /var/log/server-ticket.log 2>> /var/log/server-ticket.log </dev/null
Run Code Online (Sandbox Code Playgroud)

以下是完整脚本,基于Till Klampaeckel 的教程

start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/server-ticket.pid --exec /usr/local/zend/bin/php /var/www/server/consultpilot/ServerTicket.php >> /var/log/server-ticket.log 2>> /var/log/server-ticket.log </dev/null
Run Code Online (Sandbox Code Playgroud)

有关信息,当我开始这个过程时,没有回报。但是当我完成它时,它告诉我没有相应的进程:

root:/var/run$ service server-ticket start
Starting Daemon for the Server Ticket from DiffMed: result : 0
server-ticket.
root:/var/run$ service server-ticket stop
Stopping Daemon for the Server Ticket from DiffMed: start-stop-daemon: warning: failed to kill 5772: No such …
Run Code Online (Sandbox Code Playgroud)

php daemon init.d

6
推荐指数
1
解决办法
5438
查看次数

标签 统计

daemon ×1

init.d ×1

php ×1