我的 app.service 文件的 [Service] 部分如下:-
[Service]
Type=forking
Restart=no
IgnoreSIGPIPE=no
GuessMainPID=no
ExecStart=/opt/app/appl_init.d start
ExecStop=/opt/app/appl_init.d stop
TimeoutSec=infinity
之后我安装了应用程序,文件被正确复制到/usr/lib/systemd/system/app.service
.
我已经运行了systemctl daemon-reload
,但它似乎对启动时间没有影响!它在我运行时失败systemctl start app
或systemctl reload app.service
出现以下错误:-
Job for app.service failed because a fatal signal was delivered to the control process. See "systemctl status app.service" and "journalctl -xe" for details
的输出systemctl status app
是: -
● app.service - ApplicationTest
Loaded: loaded (/opt/app/appl_init.d; enabled; vendor preset: disabled)
Active: failed (Result: signal) since Tue 2017-03-21 01:55:22 EDT; 1min 4s ago
Docs: man:app(8)
Process: 4126 ExecStart=/opt/app/appl_init.d start (code=killed, signal=KILL)
Mar 21 01:55:22 centosvm systemd[1]: Starting ApplicationTest...
Mar 21 01:55:22 centosvm systemd[1]: app.service start operation timed out. Terminating.
Mar 21 01:55:22 centosvm systemd[1]: app.service stop-final-sigterm timed out. Killing.
Mar 21 01:55:22 centosvm systemd[1]: app.service: control process exited, code=killed status=9
Mar 21 01:55:22 centosvm systemd[1]: Failed to start ApplicationTest.
Mar 21 01:55:22 centosvm systemd[1]: Unit app.service entered failed state.
Mar 21 01:55:22 centosvm systemd[1]: app.service failed.
我注意到的另一件奇怪的事情是,当我跑步时systemctl show app.service -p TimeoutSec
,我没有得到任何结果;它是空白的?
我试过做一个systemctl reboot
,但仍然没有骰子。
当然,当我将值更改为其他任何值时TimeoutSec=5min
,它都可以正常工作。但我真的需要这个应用程序来占用无穷大。
我哪里错了?