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

systemd instantiated timers are not started when enabled via ignition #1064

Closed
paulnivin opened this issue Aug 7, 2020 · 5 comments
Closed
Assignees
Labels

Comments

@paulnivin
Copy link

Bug

Instantiated timers can be enabled and return no error, but when machine boots, timer is not enabled:

variant: fcos
version: 1.1.0
systemd:
  units:
    - name: echo@foo.service
      enabled: true
    - name: echo@foo.timer
      enabled: true
    - name: echo@.service
      contents: |
        [Unit]
        Description=echo service template
        [Service]
        Type=oneshot
        ExecStart=/bin/echo %i
        [Install]
        WantedBy=multi-user.target
    - name: echo@.timer
      contents: |
        [Unit]
        Description=echo timer template
        [Timer]
        OnUnitInactiveSec=10s
        [Install]
        WantedBy=timers.target

Relevant prior issues are #588 to remove presets entirely and #586 which enabled instantiated service units to work correctly; however #586 doesn't address instantiated timer units.

Operating System Version

# rpm-ostree status
State: idle
Deployments:
* ostree://fedora:fedora/x86_64/coreos/stable
                   Version: 32.20200715.3.0 (2020-07-27T11:36:29Z)
                    Commit: a3b08ee51b1d950afd9d0d73f32d5424ad52c7703a6b5830e0dc11c3a682d869
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0

Ignition Version

ignition-2.4.1-1.git5260a5b.fc32.x86_64

Environment

qemu

Expected Behavior

Enabled instantiated timers start

Actual Behavior

Enabled instantiated timers are not started

Reproduction Steps

  1. Create instantiated timer and enable in ignition
  2. Boot and observe the timer is not enabled

Other Information

Immediately following a boot, echo@foo.service unit starts as expected; however the echo@foo.timer unit is disabled:

# systemctl status echo@foo.service
● echo@foo.service - echo service template
     Loaded: loaded (/etc/systemd/system/echo@.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2020-08-07 20:36:40 UTC; 28s ago
    Process: 823 ExecStart=/bin/echo foo (code=exited, status=0/SUCCESS)
   Main PID: 823 (code=exited, status=0/SUCCESS)

Aug 07 20:36:39 localhost systemd[1]: Starting echo service template...
Aug 07 20:36:39 localhost echo[823]: foo
Aug 07 20:36:40 localhost systemd[1]: echo@foo.service: Succeeded.
Aug 07 20:36:40 localhost systemd[1]: Finished echo service template.

# systemctl status echo@foo.timer
● echo@foo.timer - echo timer template
     Loaded: loaded (/etc/systemd/system/echo@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● echo@foo.service

# cat /etc/systemd/system-preset/20-ignition.preset
enable echo@.service foo
enable echo@.timer foo 

The instantiated timer can be enabled with --now after boot to cause it to start:

# systemctl enable --now echo@foo.timer
Created symlink /etc/systemd/system/timers.target.wants/echo@foo.timer → /etc/systemd/system/echo@.timer.

# systemctl status echo@foo.timer
● echo@foo.timer - echo timer template
     Loaded: loaded (/etc/systemd/system/echo@.timer; enabled; vendor preset: enabled)
     Active: active (waiting) since Fri 2020-08-07 20:38:24 UTC; 31s ago
    Trigger: Fri 2020-08-07 20:39:02 UTC; 7s left
   Triggers: ● echo@foo.service

Aug 07 20:38:24 localhost systemd[1]: Started echo timer template.
@sohankunkerkar sohankunkerkar self-assigned this Aug 11, 2020
@sohankunkerkar sohankunkerkar added the jira for syncing to jira label Aug 11, 2020
@sohankunkerkar
Copy link
Member

This is an upstream bug and needs to be fixed in the systemd repo. I'm planning to work on this in the next sprint.

@sohankunkerkar
Copy link
Member

This issue is resolved by the upstream patch: systemd/systemd#16816
I have had a word with one of the maintainers of the systemd project, and it looks like they are planning to backport this change to the stable release. I will update this thread once I get the confirmation.

keszybz added a commit to systemd/systemd-stable that referenced this issue Sep 20, 2020
Fixes coreos/ignition#1064.

(cherry picked from commit 47ab95f)
(cherry picked from commit ba6e7f7)
(cherry picked from commit 79638f6)
(cherry picked from commit bea900b)
keszybz added a commit to systemd/systemd-stable that referenced this issue Sep 20, 2020
Fixes coreos/ignition#1064.

(cherry picked from commit 47ab95f)
(cherry picked from commit ba6e7f7)
(cherry picked from commit 79638f6)
keszybz added a commit to systemd/systemd-stable that referenced this issue Sep 20, 2020
@sohankunkerkar
Copy link
Member

sohankunkerkar commented Sep 22, 2020

This fix is already backported to v245 (which is used by F-32)https://bodhi.fedoraproject.org/updates/FEDORA-2020-0d29e88946
It's still in the testing phase so needs some time before it reaches thefedora-coreos-pool repos.

@bgilbert
Copy link
Contributor

@sohankunkerkar We could fast-track it to the FCOS next and testing streams if desired.

sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 22, 2020
Related to coreos/ignition#1064
This change will ensire to cover that test case in CI
sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 22, 2020
Related to coreos/ignition#1064
This change will ensure to cover that test case in CI
sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 22, 2020
Related to coreos/ignition#1064
This change will ensure to cover the `systemd instantiated timer` test case in CI.
sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 22, 2020
Related to coreos/ignition#1064
This change will ensure to cover the `systemd instantiated timer` test case in CI.
sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 22, 2020
Related to coreos/ignition#1064
This change will ensure to cover the `systemd instantiated timer` test case in CI.
sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 23, 2020
Related to coreos/ignition#1064
This change will ensure to cover the `systemd instantiated timer` test case in CI.
sohankunkerkar added a commit to coreos/fedora-coreos-config that referenced this issue Sep 23, 2020
This version has a fix for the Ignition issue (coreos/ignition#1064)
sohankunkerkar added a commit to coreos/fedora-coreos-config that referenced this issue Sep 23, 2020
This version has a fix for the Ignition issue (coreos/ignition#1064)
sohankunkerkar added a commit to sohankunkerkar/coreos-assembler that referenced this issue Sep 23, 2020
Related to coreos/ignition#1064
This change will ensure to cover the `systemd instantiated timer` test case in CI.
openshift-merge-robot pushed a commit to coreos/coreos-assembler that referenced this issue Sep 23, 2020
Related to coreos/ignition#1064
This change will ensure to cover the `systemd instantiated timer` test case in CI.
kelvinfan001 pushed a commit to kelvinfan001/fedora-coreos-config that referenced this issue Sep 25, 2020
This version has a fix for the Ignition issue (coreos/ignition#1064)
@sohankunkerkar
Copy link
Member

This issue is fixed in the latest testing and next stream releases and will be fixed in the next stable stream release. I'm closing this issue for the time being. Please feel free to open it again if you find any issue.

dtardon pushed a commit to dtardon/systemd-rhel8 that referenced this issue Nov 10, 2020
systemd-rhel-bot pushed a commit to redhat-plumbers/systemd-rhel8 that referenced this issue Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants