Setting timeout for custom service (chkconfig)

时间:2017-07-12 08:08:56

标签: linux redhat systemctl

I wrote a custom script that I want to be executed each time my server starts and stops. I added the script with chkconfig:

chkconfig --add myservice

This is working fine. But from time to time I run into timeout. I check the systemctl settings and I can see the timeout is set to 5 min:

systemctl show myservice.service | grep Timeout
TimeoutStartUSec=5min
TimeoutStopUSec=5min
JobTimeoutUSec=0
JobTimeoutAction=none

So I assumed I need to create a file with service settings under /etc/systemd/system, but each time I do that, my service is not executing at all and disappears from chkconfig --list.

When I run systemctl list-unit-files, in addition, I can see my service status is set to masked. But when I delete the file from /etc/systemd/system everything is back to normal.

Could anyone explain me how can I customize the startup for my service?

Best regards Fr.

0 个答案:

没有答案