我想让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电子邮件从来没有发过。我试过后发制人和主管,但也没用。
有什么建议吗?
发布于 2014-01-27 23:55:02
echo "ntpd Service Respawned" | mail -s "ntpd Service Respawned" my_email@gmail.com试试这个。
https://stackoverflow.com/questions/21384969
复制相似问题