4
这是我正在运行的工作的一个例子。如果它退出,我希望收到通知,因为它很重要。如果工作停止运行,让Upstart向我发送电子邮件通知的最佳方式是什么?
(我知道PHP是不是这样做的最佳工具,但它是别人的代码,所以,不管)
/etc/init/watchdog.conf
# Events
start on startup
stop on shutdown
# Automatically respawn
respawn
respawn limit 20 5
# Run the script!
script
exec $PHP_PATH/php -f $WD_PATH/index.php wd_run
end script
有没有办法检测过程是否停止与手动停止? – 2014-10-30 18:14:52
'post-stop'会这样 - 它在失败时运行 – 2014-10-30 18:16:55
太棒了,这就是我所需要的。谢谢。 – 2014-10-30 18:20:30