-
Notifications
You must be signed in to change notification settings - Fork 291
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
ConditionNeedsUpdate needs /usr to have newer modification time than /etc #1628
Comments
The idea behind endlessm/ostree@9ef61fd seems generally OK to me. I just have minor code style nits, and it'd be good to have a test. @dbnicholson I vaguely recall this came up before - let's try to get this upstream? |
@peterbaouoft Would you mind testing this patch fixes the problem for rpm-ostree+sysusers? |
No, not at all, will be trying it out =). |
Yup, it does fix the problem for |
@cgwalters yes, please. My cleaner version with tests (based on 2018.4, don't have time to rebase on master at the moment) is in dbnicholson@6b3d0cc. |
BTW, this is also https://bugzilla.gnome.org/show_bug.cgi?id=752950. |
Systemd units using ConditionNeedsUpdate run if the mtime of .updated in the specified directory is newer than /usr. Since /usr has an mtime of 0, there's no way to have an older .updated file. Systemd units typically specify ConditionNeedsUpdate=/etc or ConditionNeedsUpdate=/var to support stateless systems like ostree. Remove the file from the new deployment's /etc and the OS's /var regardless of where they came from to ensure that these systemd units run when booting new deployments. This will provide a method to run services only on upgrade. Closes: ostreedev#1628 https://bugzilla.gnome.org/show_bug.cgi?id=752950
I rebased my branch now in #1631 and it passes locally. |
Hi,
For
/usr
on Atomic host, the modification time is canonicalized to epoch (1970) by ostree, and this makes /usr always older than /etc.However, to have system-sysusers( or any service with ConditionNeedsUpdate ) to trigger automatically during boot time, /usr needs to be newer than /etc due to ConditionNeedsUpdate=/etc in the service file:
Reading a bit from systemd code base, it seems like ConditionNeedsUpdate needs /usr to be strictly newer than /etc (i.e only > and not >=). See code and documentation.
Endless seem to already have an implementation to fix this: Related commit: endlessm/ostree@9ef61fd \o/
Migrated from coreos/rpm-ostree#1415
The text was updated successfully, but these errors were encountered: