New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: add MaxRuntimeSec= setting that terminates a service after a max runtime #2249
Comments
why not specify Conflicts= for the service, does it not do what you expect it to do? |
don't think so. afaik a Conflicting unit would knock the running one out.
but that's just writing another unit and telling it to start at the end of
the shift (11:00am in my case). i have a workaround like that atm however
it doesn't involve using 'Conflicts='. it works as long as the process i'm
running has single instance. i understand that 'killall $process_name'
might work for cases where there is more than one instance.
anyway, would you care to explain a bit more how you would use 'Conflicts='?
|
I am not convinced timers should do anything but starting other units. However, I am open to add a MaxRuntimeSec= parameter to service units instead? That setting would specifiy the maximum runtime for a service, which would be mostly equivalent. Does that make sense to you? |
sorry didn't get the update for this... |
All our XyzSec= settings also accept arbitrary time units, including hours. See systemd.time(5). The "Sec" suffix simply indicates which unit is implied, if none is explicitly specified. |
i see; it all sounds good to me. thanks.
|
i have a network intensive task that is to run during low-traffic hours (2:00am to 11:00pm). starting the task with a systemd.timer is fine and cron-dandy. but adding a directive to the timer files to stop the task (execute ExecStop) would be a novel ideal, me thinks.
The text was updated successfully, but these errors were encountered: