【问题标题】:Running a Python service on ubuntu using upstart使用 upstart 在 ubuntu 上运行 Python 服务
【发布时间】:2012-04-03 10:14:59
【问题描述】:

我想创建以使用 Upstart 将心跳服务(python 脚本)部署为服务。

我的理解是我必须添加一个/etc/init/myheartbeatservice.conf,其内容如下。

# my heartbeat service 

description     "Heartbeat monitor"

start on startup
stop on shutdown

script
    exec /path/to/my/python/script.py
end script 

我的脚本启动另一个服务进程并监视进程并定期向外部服务器发送心跳。 startupshutdown 是正确的事件吗? 我的脚本也创建了一个新线程。我假设我还需要将fork daemon 添加到我的 conf 文件中?

谢谢。

【问题讨论】:

    标签: ubuntu service heartbeat upstart


    【解决方案1】:

    Upstart 只设置了少数环境变量。您的应用程序是否需要这些集合中的任何一个?

    查看类似问题的答案:Need help running Python app as service in Ubuntu with Upstart

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-08
      • 1970-01-01
      • 2013-01-19
      • 2017-07-02
      • 2015-03-19
      • 1970-01-01
      • 1970-01-01
      • 2018-04-04
      相关资源
      最近更新 更多