尽管在配置文件中重生,但 ubuntu 新贵并未重生守护进程
我的守护进程重启时遇到问题。当守护进程崩溃时,upstart 不会生成守护进程。 这是我的新贵初始化文件。 请告知。
description "bezkon watch dog"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
expect fork
script
logger -s "Bezkon watch dog booting ..."
logger -s "Waiting for engine to complete booting sleeping for 60 seconds "
sleep 300
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export LUA_PATH=$LUA_PATH:/usr/local/bezkon/
export LUA_CPATH=$LUA_CPATH:/usr/local/bezkon/
chdir /usr/local/bezkon;
end script
exec /usr/local/bezkon/bezkon_dog >> /var/log/bezkon_crash.log 2>&1
I have problems with my deamon restart. upstart is not spawning the daemon when the daemon crashes.
here is my upstart init file .
pls advise.
description "bezkon watch dog"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
expect fork
script
logger -s "Bezkon watch dog booting ..."
logger -s "Waiting for engine to complete booting sleeping for 60 seconds "
sleep 300
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export LUA_PATH=$LUA_PATH:/usr/local/bezkon/
export LUA_CPATH=$LUA_CPATH:/usr/local/bezkon/
chdir /usr/local/bezkon;
end script
exec /usr/local/bezkon/bezkon_dog >> /var/log/bezkon_crash.log 2>&1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您不能同时使用
script
和exec
。请尝试使用预启动脚本
。或者将 exec 行放在脚本节内。但不确定它如何与expect fork
一起使用。编辑:看看 Scott 的 此错误评论 Remnant,领先的 Upstart 开发者。看起来它会应用到您的配置文件,并且似乎尚未修复。我仍然认为您可能想尝试
预启动脚本
,或者尝试使用expect daemon
与expect fork
与什么都不做。假设您还没有这样做,那也没什么坏处。I don't think you can use
script
andexec
together. Trypre-start script
instead. Or put the exec line inside the script stanza. Not sure how this works together withexpect fork
though.EDIT: Take a look at this bug comment by Scott Remnant, the lead Upstart dev. It looks like it would apply to your config file, and it doesn't appear that it has been fixed yet. I still think you might want to try
pre-start script
, or experiment withexpect daemon
vs.expect fork
vs. nothing. Assuming you haven't done this already, it can't hurt.