-
Notifications
You must be signed in to change notification settings - Fork 248
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
internal/exec/util: check if unit exists before disabling #1621
Conversation
1d9815a
to
3932159
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit message, let's specify the systemd version that changed the behavior. Bonus points for linking to the commit.
We should also link to the Ignition issue, and mention the blackbox test that this fixes.
f5fe758
to
f659a9e
Compare
So re: the commit, I put the hash, but would it be better to include the whole link? (didnt know what convention was)
11000001% for both. I need to track down the blackbox test really quick but I will add that as well, (sorry did not include it in the latest push) |
A link is the most future-proof; you can shorten the commit hash in the link to 10 characters or so. Since systemd is on GitHub, a middle ground is to say Also, you have a couple sentence fragments in the commit message. |
2b8c592
to
be65cb4
Compare
I agree that the problem was introduced in systemd 252. Fedora 37 has 251 and doesn't have the problem, while #1614 says that 252 is affected. However, systemd/systemd@7a6c73d can't have been the culprit, since that's in 251. If all we have to pinpoint the commit is the report in #1614, let's just drop the commit hash from the message. It's not worth trying to track down the exact change. For the commit message, how about something like this?
It's useful to record the details of the failing test for searchability. |
Yeah I did not track down the exact change outside of the report. I will drop that detail thank you for fact checking, I should have done that.
yes that def sounds more clear :(
Ok, I was on the edge (before your message) of not including the blackbox test, mostly because it felt like a large amount of focus on the cause of the change rather then the change. Though after reading your commit message I do like it. |
be65cb4
to
08741d9
Compare
I ended up taking some of your suggestion and adjusted it to my taste I hope that I did not make it worse lol. |
Yeah, that's true. But, when there's a concise failure (error message or test failure), I think it's useful to include that to help with reproducing the issue later (or finding the previous fix if the fix regresses). I like the additional detail in the commit message, but I can't let
And remember to update the PR title/description also. |
Ignition depends on `systemctl disable` for disabling units. Currently if the unit does not exist `systemctl disable` exits 1; however, before systemd 252 `systemctl disable` exits 0 if `--root` is specified. Since Ignition depends on systemctl's exit code the new behavior caused a regression, causing the unit.remove.symlinks blackbox test to fail with: removing enablement symlink(s) for "enoent.service": cannot remove symlink(s) for enoent.service: exit status 1: "Failed to disable unit, unit enoent.service does not exist.\n" Before disabling a unit, use `systemctl is-enabled` to verify that the unit exists and is enabled. Fixes coreos coreos#1614
08741d9
to
13ecdf1
Compare
Ignition depends on
systemctl disable
for disabling units. Currentlyif the unit does not exist
systemctl disable
exits 1; however, beforesystemd 252
systemctl disable
exits 0 if--root
is specified. SinceIgnition depends on systemctl's exit code the new behavior caused a
regression, causing the unit.remove.symlinks blackbox test to fail with:
Before disabling a unit, use
systemctl is-enabled
to verify that theunit exists and is enabled.
Fixes #1614.