Bug 902110
Summary: | RFE: support restarting unit on calendertime | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jóhann B. Guðmundsson <johannbg> |
Component: | systemd | Assignee: | systemd-maint |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | harald, johannbg, lnykryn, metherid, msekleta, notting, plautrba, systemd-maint, vpavlin |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-07-26 01:29:49 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 784611 |
Description
Jóhann B. Guðmundsson
2013-01-20 22:25:36 UTC
Can be solved by: # cat ServiceRestart [Unit] Description=Restart sshd service every minute [Timer] OnCalendar=*-*-* *:*:00 # cat ServiceRestart@.service [Unit] Description=Restart service %I [Service] ExecStart=/usr/bin/systemctl restart %I.service You could also with a script and execute that from cron like having to create two units. Sorry to say but from my pov view the whole integration of "timer" is not so good both from usability perspective and consistency with units types for this to be useful and consistent for administrators we ought to support simply adding an switch to Restart= followed supporting defining OnCalender= in [service] sections by doing so we a) support what this request is for b) properly can intergrade timer jobs in services without having to result to create a specific timer unit and start "Binding" them and what not to other service I agree with Harald, what he suggests in #1 is a solution that is "good enough". We should be very careful with making things like this "too easy", since they actually might cause races where the admin edits a configuration file and the cronjob then restarts the service in the background while the configuration file is only half-written. it's fine if admins hack things up to make a service restart in fixed intervals, but I am very conservative on making something like this a primary functionality of systemd. Sorry, I am not convinced that adding this would be a good idea, hence closing. |