Skip to content

systemd: fix tmpfiles errors when mount is noatime - #523026

Merged
ElvishJerricco merged 1 commit into
NixOS:stagingfrom
PaulGrandperrin:systemd-tmpfile-noatime
May 26, 2026
Merged

ElvishJerricco merged 1 commit into
NixOS:stagingfrom
PaulGrandperrin:systemd-tmpfile-noatime

Conversation

@PaulGrandperrin

Copy link
Copy Markdown
Contributor

fixes #520485

I followed the instructions of the "PATCH POLICY" so the patch should be formatted as expected.

I added a small comment as recommended by @nikstur .

I guess it'll only go to 26.11 now, what about 26.05? Should I open another PR or could you add the backport label?

@PaulGrandperrin
PaulGrandperrin requested review from ElvishJerricco and nikstur and removed request for ElvishJerricco May 22, 2026 13:08
@PaulGrandperrin
PaulGrandperrin force-pushed the systemd-tmpfile-noatime branch from c2a79c3 to 7044fa2 Compare May 22, 2026 13:09
nixpkgs-branch-check[bot]

This comment was marked as outdated.

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team, aanderse, arianvp, balsoft, flokli, infinisil and pyrox0 May 22, 2026 13:18
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels May 22, 2026
@PaulGrandperrin
PaulGrandperrin changed the base branch from master to staging May 22, 2026 13:20
@nixpkgs-ci nixpkgs-ci Bot closed this May 22, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this May 22, 2026
@nixpkgs-branch-check
nixpkgs-branch-check Bot dismissed their stale review May 22, 2026 13:29

Review dismissed automatically

@RaitoBezarius RaitoBezarius added the backport staging-26.05 Backport PR automatically label May 25, 2026

@GrimmTheShrimp GrimmTheShrimp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fetched the PR onto my own server running into similar issues (noatime zfs), and that made the errors shut up. I am not familiar enough with the code to judge whether this is a good fix, but seeing as it was merged upstream i am hoping it is. Seeing as people run into this on 26.05, we should probably just merge this...

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels May 25, 2026
@matdibu

matdibu commented May 26, 2026

Copy link
Copy Markdown
Contributor

is there a general preference in nixpkgs with regard to vendoring vs fetching files?

this could be done via

fetchpatch2 {
  url = "https://github.com/systemd/systemd/commit/df45055942330fcd2b77389e449905e7f6ca34ec.patch?full_index=1";
  hash = "sha256-1HfIXVaidXdgPO5tZAjd7xJoWM7Ui+xgf8lnq0KU/5g=";
}

@PaulGrandperrin

Copy link
Copy Markdown
Contributor Author

It is not visible in the diff but there is a special "PATCH POLICY" in systemd: https://github.com/PaulGrandperrin/nixpkgs/blob/master/pkgs/os-specific/linux/systemd/default.nix#L213

@PaulGrandperrin

PaulGrandperrin commented May 26, 2026 •

Copy link
Copy Markdown
Contributor Author

I think it makes it easier to maintain nixos-specific patches without having to resort to a fork of systemd as it used to: #488508 and #80038

The main issue I see is that it makes it a lot harder for the security team to ensure that PRs like this one really added the commits it pretends to add. I guess they'll have to basically check line by line against the real upstream commits...

@PaulGrandperrin

Copy link
Copy Markdown
Contributor Author

Maybe an exception could be added to this policy for temporary upstream patches (like in this case) that will not need to be maintained by NixOS?

@ElvishJerricco ElvishJerricco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulGrandperrin The systemd package's patch policy does not say that you must vendor the patch file into nixpkgs. All it says is the circumstances when it's acceptable to patch systemd, not that those patches have to be vendored in-tree. In fact the nixpkgs documentation says the opposite: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#fetching-patches

In the interest of keeping our maintenance burden and the size of Nixpkgs to a minimum, patches already merged upstream or published elsewhere should be retrieved using fetchpatch2:

(though I think that's slightly outdated and now fetchpatch is generally preferred over fetchpatch2)

The instructions in the lines following the policy about rebasing and formatting the patches are just for the patches that we do have to vendor.

Other than that, these patches have been accepted upstream to fix a bug. I think they clearly qualify for the patch policy and this is good to merge once the vendoring has been changed to fetching.

@PaulGrandperrin
PaulGrandperrin force-pushed the systemd-tmpfile-noatime branch from 7044fa2 to d28f57c Compare May 26, 2026 19:21
@PaulGrandperrin

Copy link
Copy Markdown
Contributor Author

I though it was implied, but I'm happy I misinterpreted the policy because I was concerned about the burden it added for security reviews.

@ElvishJerricco
ElvishJerricco added this pull request to the merge queue May 26, 2026
Merged via the queue into NixOS:staging with commit bd840aa May 26, 2026
24 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for staging-26.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label May 26, 2026
@r-vdp r-vdp added the backport release-26.05 Backport PR automatically label May 27, 2026
@r-vdp r-vdp removed the backport release-26.05 Backport PR automatically label May 27, 2026
@NixOS NixOS deleted a comment from nixpkgs-ci Bot May 27, 2026
@GrimmTheShrimp

Copy link
Copy Markdown
Contributor

Upstream just released 260.2, which includes the noatime fixes: systemd/systemd@v260.1...v260.2

@nikstur

nikstur commented May 28, 2026

Copy link
Copy Markdown
Contributor

Upstream just released 260.2, which includes the noatime fixes: systemd/[email protected]

But systemd/systemd@df45055 does not seem to be included in the 260.2 tag, right?

@matdibu

matdibu commented May 28, 2026

Copy link
Copy Markdown
Contributor

But systemd/systemd@df45055 does not seem to be included in the 260.2 tag, right?

according to github's webui, it's only in v261 release candidates

image

however, this commit with slightly different changes is in v260.2

systemd/systemd@77b550c

@GrimmTheShrimp

Copy link
Copy Markdown
Contributor

oh yeah i didn't check git webui, i just grepped git log for atime

@PaulGrandperrin

Copy link
Copy Markdown
Contributor Author

I just built and booted on systemd v260.2 and I can confirm 2 things:

  • this PR patch doesn't apply anymore
  • the noatime bug is indeed fixed!

Sorry I didn't catch that but since I didn't get any answers from the systemd devs I didn't look too hard.

@GrimmTheShrimp

Copy link
Copy Markdown
Contributor

Sorry I didn't catch that but since I didn't get any answers from the systemd devs I didn't look too hard.

You couldn't have, 260.2 released just a few hours after this was merged.

@infinisil infinisil moved this from Needs Review to Reviewed in Nixpkgs security review May 29, 2026
@jackrosenberg

jackrosenberg commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Still getting this while build off master:
systemd-tmpfiles[8344]: statx(/var/empty) failed: Protocol driver not attached

Can this be merged and backported to master & stable?
Edit:
just saw https://www.github.com/NixOS/nixpkgs/pull/524791, sorry for ping everybody :)

@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/26-05-systemd-tmpfiles-clean-protocol-driver-not-attached/78101/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. backport staging-26.05 Backport PR automatically

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

systemd: systemd-tmpfiles-clean.service always fails because filesystem is mounted with noatime

9 participants