简体   繁体   English

为什么我的 Upstart 服务在重启后无法启动?

[英]Why won't my Upstart service start after reboot?

I have a golang script I want to always be running, and it should restart on reboot.我有一个想要始终运行的 golang 脚本,它应该在重新启动时重新启动。

I have a corresponding gopush.conf file in /etc/init/ :我在/etc/init/有一个相应的gopush.conf文件:

start on filesystem or runlevel [2345]
stop on runlevel [!2345]

setuid doe
setgid doe

respawn
respawn limit 5 2

exec /home/doe/test

I type sudo service gopush start and it begins running beautifully.我输入sudo service gopush start ,它开始运行sudo service gopush start漂亮。

If I type sudo reboot , then ssh back in, and type sudo service gopush status it is always set to stop/waiting .如果我输入sudo reboot ,然后 ssh 重新输入,然后输入sudo service gopush status它总是设置为stop/waiting

What am I doing wrong here?我在这里做错了什么? Why won't it start?为什么不启动? I thought that's what the start on... line did?我以为这就是start on...线路做了什么?

Did you try removing the filesystem from the start on line? 您是否尝试过start on删除filesystem

Try using: 尝试使用:

start on runlevel [2345]

Also, it will help, if you can mention which version of Ubuntu, you are using. 此外,如果您可以提及所使用的Ubuntu版本,它也会有所帮助。

start on startup时使用start on startupstop on shutdown并且在 RedHat 6.8 上工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM