Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • A slight improvement here is to use systemctl set-property, which will essentially do the management of an override for you in a much simpler way. Using --runtime is also possible, since having the overrides in /run is probably OK (boot needs special handling anyway, since there's no guarantee restart will be in the same state at that point.) Commented Nov 15, 2018 at 4:04
  • In short, at 08:00 run systemctl --runtime set-property wibble.service Restart=yes and at 17:00 run systemctl --runtime set-property wibble.service Restart=no. At boot, need to run a shell script that will check whether the current hour is in [8, 17) and set it to yes, otherwise to no. Commented Nov 15, 2018 at 4:06
  • It's not an improvement for the simple reason that it does not actually work. (-: The manual explains why. Commented Nov 15, 2018 at 11:50