systemd服务无法启动错误:“主进程退出,代码=退出,状态= 3 /未实现”


0

当我启动systemd服务时,我收到以下错误

[localhost.localdomain]-> systemctl status rcc_rccproxy.service 
* rcc_rccproxy.service - starts RCC Proxy process
   Loaded: loaded (/etc/systemd/system/rcc_rccproxy.service; enabled; vendor 
preset: disabled)
   Active: failed (Result: exit-code) since Wed 2009-03-25 21:46:27 CDT; 
12min ago
  Process: 7597 ExecStart=/var/RCC/rccproxy.sh (code=exited, status=3)
 Main PID: 7597 (code=exited, status=3)

Mar 25 21:46:27 localhost.localdomain systemd[1]: Started starts RCC Proxy 
process.
Mar 25 21:46:27 localhost.localdomain systemd[1]: Starting starts RCC Proxy 
process...
Mar 25 21:46:27 localhost.localdomain systemd[1]: rcc_rccproxy.service: main 
process exited, code=exited, status=3/NOTIMPLEMENTED
Mar 25 21:46:27 localhost.localdomain systemd[1]: Unit rcc_rccproxy.service 
entered failed state.
Mar 25 21:46:27 localhost.localdomain systemd[1]: rcc_rccproxy.service 
failed.

这是什么原因?状态错误表示什么?

基本上这个服务正在启动一个shell脚本。如果我手动运行相同的脚本,不要看到任何错误。

此PID的Journalctl日志也不会显示任何内容。


关于为什么某些东西从CLI而不是在systemd下运行的问题是FAQ。请看: unix.stackexchange.com/a/339645/20239
Mark Stosberg

Answers:


0

如果我手动运行相同的脚本,不要看到任何错误

最有可能的是,退出代码3由shell脚本发出。如果你执行shell脚本然后执行“$?”,如果这导致“3” - 那么你应该在你的成功状态代码中添加3。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.