【问题标题】:Ubuntu 16.04 server custom serviceUbuntu 16.04 服务器定制服务
【发布时间】:2017-05-02 22:52:30
【问题描述】:

有没有办法在 ubuntu 16.04 中创建自定义服务? 我想要一些在启动时自动启动的东西,可以通过 service mycustomservice start 进行管理

并且服务应该启动一个php websocket:(php ratchet)

php -f socket.php

【问题讨论】:

  • 至少你能告诉我为什么投反对票吗?只是为了理解。我在谷歌上搜索过,但没有。
  • 尝试使用 crontab

标签: service daemon ubuntu-16.04 ubuntu-server


【解决方案1】:

试试supervisorenter link description here

[program:ratchet]
command                 = bash -c "ulimit -n 10000; exec /usr/bin/php ./bin/tutorial-terminal-chat.php"
process_name            = Ratchet
numprocs                = 1
autostart               = true
autorestart             = true
user                    = root
stdout_logfile          = ./logs/info.log
stdout_logfile_maxbytes = 1MB
stderr_logfile          = ./logs/error.log
stderr_logfile_maxbytes = 1MB

【讨论】:

    猜你喜欢
    • 2017-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多