Skip to content
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

Closed
257 opened this issue Jan 1, 2016 · 6 comments
Closed
Labels
pid1 RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@257
Copy link

257 commented Jan 1, 2016

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.

@sztanpet
Copy link

sztanpet commented Jan 1, 2016

why not specify Conflicts= for the service, does it not do what you expect it to do?

@257
Copy link
Author

257 commented Jan 1, 2016 via email

@poettering
Copy link
Member

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?

@poettering poettering added RFE 🎁 Request for Enhancement, i.e. a feature request pid1 labels Jan 12, 2016
@257
Copy link
Author

257 commented Jan 23, 2016

sorry didn't get the update for this...
i was more hoping for OnCalendarStop=. with MaxRuntimeSec= users will of course have to convert to hours to secs by hand in some cases.

@poettering
Copy link
Member

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.

@257
Copy link
Author

257 commented Jan 27, 2016 via email

@poettering poettering changed the title add hooks for systemd.timer's to trigger ExecStop RFE: add MaxTimeoutSec= setting that terminates a service after a max runtime Jan 27, 2016
@poettering poettering changed the title RFE: add MaxTimeoutSec= setting that terminates a service after a max runtime RFE: add MaxRuntimeSec= setting that terminates a service after a max runtime Jan 27, 2016
@zonque zonque closed this as completed in 36c16a7 Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pid1 RFE 🎁 Request for Enhancement, i.e. a feature request
Development

No branches or pull requests

3 participants