Red Hat Bugzilla – Bug 1478832
Cockpit-created systemd timers cannot be enabled and don't run
Last modified: 2017-09-19 02:26:06 EDT
Description of problem: Cockpit's "Services" page has a feature to create timers (.timer systemd units). But they are not created properly: the [Install] section belongs into the actual .timer unit, not the corresponding .service unit that they run. Thus the timers created through that page are broken and inert.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Open Cockpit (e. g. <https://localhost:9090>), log in and navigate to "Services" page.
2. Click "Timers" button on the top
3. Click "Create Timer" button on the top right
4. Enter some data into the creation dialog:
Service name: foo
Description: test timer
Command: /bin/touch /tmp/timer.stamp
Leave "Run" as "After system boot" and set "After" to e. g. 10 seconds.
5. Click "Save"
6. The timer appears in the third table for "Static" units. Clicking it and trying to enable it does nothing.
7. Reboot the machine. /tmp/timer.stamp is never created, and `systemctl status foo.timer` says "static" and "inactive/dead". `foo.service` has never run.
6. The timer appears in the second table for "Disabled" units. Click it, and click the "Enable" button. It should then move to the "Enabled" units table.
7. Reboot the machine. /tmp/timer.stamp is created shortly after booting, and `systemctl status foo.service` shows success.
* This got fixed in Cockpit 139 in <https://github.com/cockpit-project/cockpit/pull/6324>.
* Testing this particular feature got disabled in <https://github.com/cockpit-project/cockpit/commit/66de1a701af#diff-906e3fa5138f12026b94363091c80971>; once the fix lands in RHEL 7.4, the test case should be re-enabled.