【发布时间】:2014-02-18 12:49:10
【问题描述】:
我正在尝试让 Upstart 在进程重新启动时向我发送电子邮件。 因此,在 upstart 节之后,这是我的 ntpd 服务的 upstart 脚本(仅作为示例):
/etc/init/ntpd.conf
### ntpd
script
mail -s "ntpd Service Respawned" my_email@gmail.com
control + D
end script
respawn
exec /etc/init.d/ntpd start
然后,我重新加载进程 (initctl reload ntpd) 以便让新贵重新加载 ntpd.conf 的配置。然后kill -9 进程强制其重生。
这里是/var/log/message.log:
init: ntpd main process (12446) killed by KILL signal
init: ntpd main process ended, respawning
并且永远不会发送电子邮件。我已经尝试过 post-start 和 exec 但它也不起作用。
有什么建议吗?
【问题讨论】: