小编Sou*_*nta的帖子

在 Ubuntu 上使用 Upstart 的 Python 服务

我想创建以使用 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 
Run Code Online (Sandbox Code Playgroud)

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

谢谢。

upstart services

5
推荐指数
1
解决办法
3054
查看次数

标签 统计

services ×1

upstart ×1