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

OL8.10: systemd user timers fire inappropriately #171

Closed
ddrinka opened this issue Jan 22, 2025 · 3 comments
Closed

OL8.10: systemd user timers fire inappropriately #171

ddrinka opened this issue Jan 22, 2025 · 3 comments

Comments

@ddrinka
Copy link

ddrinka commented Jan 22, 2025

A regression in systemd has been introduced between OL8.8 and OL8.10, the two versions I have available to test.

Background

We keep a service user's systemd configuration in a repository and publish it to machines upon changes. Pre- and post-publishing scripts run to refresh systemd's state to ensure added services are started and removed services are stopped. A single target unit references all other units, most of which are timers.

Expected behavior

Stopping and restarting the target should reload any timers. The timers should fire as scheduled.

Actual behavior

If the timers have ever run before, upon restarting the target, all configured timers run immediately.

Versions

Not impacted: systemd 239-74.0.4.el8_8.3
Impacted: systemd 239-82.0.2.el8_10.3

Minimal Repro

mkdir -p ~/.local/share/systemd/user
cat <<EOF > ~/.local/share/systemd/user/test1.service
[Unit]
Description=Test1

[Service]
Type=oneshot
ExecStart=echo "Test1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
EOF

cat <<EOF > ~/.local/share/systemd/user/test1.timer
[Unit]
Description=Timer1
StopWhenUnneeded=true

[Timer]
OnCalendar=Mon..Fri 16:56:00
AccuracySec=1s
EOF

cat <<EOF > ~/.local/share/systemd/user/master.target
[Unit]
Description=Master Target
Wants=test1.timer

[Install]
WantedBy=default.target
EOF

systemctl --user daemon-reload
systemctl --user enable master.target
systemctl --user start master.target
# Wait for timer to fire

# Once, any time later
systemctl --user stop master.target
systemctl --user start master.target
# The test1 service starts immediately, rather than at its scheduled time

Workaround

Disabling the target before stopping it, and then reenabling it before starting avoids the unexpected behavior.

systemctl --user disable master.target
systemctl --user stop master.target
systemctl --user enable master.target
systemctl --user start master.target
# The test1 service does not start incorrectly
@YoderExMachina
Copy link
Member

Oracle Linux customers, please file your issue at https://support.oracle.com

Thanks for filing an issue with Oracle Linux.

GitHub Issues is not an official support channel and we don't offer
product support here. If you're not yet an Oracle Linux customer,
consider signing up at https://linux.oracle.com.

Even if you're not a customer, if we can confirm that an issue is a
bug we will do our best to fix it and to update this issue
once it has been fixed. We don't guarantee a fix or feedback and
for now, we will close this issue. If you have Oracle Linux support,
please use support.oracle.com to report issues.

@ddrinka
Copy link
Author

ddrinka commented Jan 23, 2025

Hi @YoderExMachina,

The old Bugzilla reporting site directed me here.
https://www.oracle.com/splash/support/custom/bugzilla.html

Image

For clarity, are you saying this bug report has been received and entered into your internal system, and you'll post updates here (in this closed card) as resolutions are identified?

@YoderExMachina
Copy link
Member

Yes, "Even if you're not a customer, if we can confirm that an issue is a bug we will do our best to fix it and to update this issue once it has been fixed."
A bug has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants