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

ostree-remount.service: RemainAfterExit=yes #1697

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Member

This is standard practice for units like this; e.g. it's what
systemd-remount-fs.service does. I think it may be part of
or the whole cause for
coreos/rpm-ostree#1471

I haven't reproduced the problem exactly but it seems to me that
if the unit starts and is GC'd, then when systemd goes to execute
a later unit it might end up restarting it.

A noticeable side effect of this is that systemctl status ostree-remount
exits with code 0 as expected.

This is standard practice for units like this; e.g. it's what
`systemd-remount-fs.service` does.  I think it may be part of
or the whole cause for
coreos/rpm-ostree#1471

I haven't reproduced the problem exactly but it seems to me that
if the unit starts and is GC'd, then when systemd goes to execute
a later unit it might end up restarting it.

A noticeable side effect of this is that `systemctl status ostree-remount`
exits with code `0` as expected.
@dustymabe
Copy link
Contributor

this is something I should be able to test on my failing system, right? would I need to make the change and then enable initrfamfs generation in order to get the change to propagate into the initrfd?

@cgwalters
Copy link
Member Author

and then enable initrfamfs generation in order to get the change to propagate into the initrfd?

Don't need to do that, this runs in the main system. You can just systemctl edit ostree-remount.service and add

[Service]
RemainAfterExit=yes

@jlebon
Copy link
Member

jlebon commented Jul 31, 2018

Good catch! This makes sense to me regardless of its (likely) role in coreos/rpm-ostree#1471. (Though cross-posting here too: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750683 indicates that oneshot services that are depended upon can indeed get executed multiple times if without RemainAfterExit=yes.)

@rh-atomic-bot r+ 6bc5f3d

@rh-atomic-bot
Copy link

⌛ Testing commit 6bc5f3d with merge dcd1522...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing dcd1522 to master...

@dustymabe
Copy link
Contributor

Don't need to do that, this runs in the main system. You can just systemctl edit ostree-remount.service

👍

This seems to have resolved the problem for me. If I add RemainAfterExit=yes then I can boot. If I take it away again I can't boot.

cgwalters added a commit to cgwalters/redhat-release-coreos that referenced this pull request Aug 28, 2018
See ostreedev/ostree#1697

Just noticed this while investigating our services after the
recent machine-id regression.
cgwalters added a commit to cgwalters/ignition-dracut that referenced this pull request Aug 28, 2018
See ostreedev/ostree#1697

Just noticed this while investigating our services after the
recent machine-id regression.
jlebon added a commit to jlebon/ostree that referenced this pull request Oct 18, 2018
For the same reasons as ostreedev#1697. This is especially important in services
that are likely to be used as an `After/Before=` target in other units.
`ostree-prepare-root.service` is one such service.
jlebon added a commit to jlebon/bootengine that referenced this pull request Oct 18, 2018
This is important for `Type=oneshot` services that may be depended upon
by other services. See ostreedev/ostree#1697.
rh-atomic-bot pushed a commit that referenced this pull request Oct 19, 2018
For the same reasons as #1697. This is especially important in services
that are likely to be used as an `After/Before=` target in other units.
`ostree-prepare-root.service` is one such service.

Closes: #1759
Approved by: cgwalters
@jlebon jlebon mentioned this pull request Mar 5, 2019
cgwalters added a commit to cgwalters/ignition-dracut that referenced this pull request Sep 23, 2019
Omitting this can cause the unit to be executed multiple
times if it's a dependency of another unit (as these are).

See ostreedev/ostree#1697
and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750683
cgwalters added a commit to cgwalters/s390-tools that referenced this pull request Oct 1, 2019
Noticed this while looking at the unit file for a different
RHEL CoreOS issue.

See ostreedev/ostree#1697
and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750683

Omitting this can cause the service to run multiple times if
something else ends up depending on it, which I'm guessing
we don't want.

Signed-off-by: Colin Walters <walters@verbum.org>
hoeppnerj pushed a commit to ibm-s390-linux/s390-tools that referenced this pull request Nov 11, 2020
Noticed this while looking at the unit file for a different
RHEL CoreOS issue.

See ostreedev/ostree#1697
and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750683

Omitting this can cause the service to run multiple times if
something else ends up depending on it, which I'm guessing
we don't want.

Closes: #72
Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
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

Successfully merging this pull request may close these issues.

None yet

4 participants