You are not logged in.

#1 2016-01-15 19:07:05

emacsomancer
Member
Registered: 2014-09-20
Posts: 138

Have systemd kill a started process if it takes too long?

I have a systemd timer set up to start a service every 5 minutes which runs mbsync to pull down my mail. Most of the time this works fine, but occassionally mbsync hangs (when the remote server disconnects unexpectedly etc.) and then no mail gets pulled down as mbsync is never restarted. What would be the best way of simply killing mbsync if it seems to be taking too long?

Offline

#2 2016-01-15 19:29:32

Raynman
Member
Registered: 2011-10-22
Posts: 1,094

Re: Have systemd kill a started process if it takes too long?

Assuming your service is of type "oneshot", I think setting TimeoutStartSec should do the trick.

Offline

Board footer

Powered by FluxBB