-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
systemd: improve our downstream patch situation #80038
Comments
Another one systemd/systemd#14884 |
Please don't open upstream issues for every NixOS-specific patch we have here - it's really on us to integrate those ;-) I had some discussion with systemd devs some time ago, most of the things should already be doable with systemd provides today, or could be more generic patches. There's some comments on some of the patches, happy to provide more context here. |
@flokli I agree patches situation has to be improved Could you split patches into "potentially upstreamable" and "no go"? For example, this one NixOS/systemd@ce79214 won't be accepted by systemd (I think). |
@danbst This patch has already been dropped in the branch linked above, with an explanation. I'll try to compile a list of the remaining ones and describe what'd need to be done there, but might not get to it this weekend. |
I added some notes on the |
The commits in the mentioned branch received quite some testing. I opened a PR against staging (with the comments removed) at #85334, PTAL. |
Once that PR has gone through, I'll clean up and post the comments from the |
FYI; I am currently running a systemd that only requires 1 patch in https://github.com/arianvp/server-optimised-nixos/blob/master/overlays/systemd.nix Biggest difference is that I install all systemd build outputs in their expected locations; and actually include all systemd units by default: I then disable the units I don't need in NixOS config: This is a slight inversion of what we have in NixOS; where we have an explicit allow-list; instead of just setting I'll see how usable this is in NixOS tree. |
Arian: can you explain the downsides of your current version and why we
shouldn't just move to the much simpler expression? I guess generators etc.
are not working / aren't being discovered?
…On Thu, Aug 6, 2020, 11:25 Arian van Putten ***@***.***> wrote:
FYI; I am currently running a systemd that only requires 1 patch in
path-util.h:
https://github.com/arianvp/server-optimised-nixos/blob/master/overlays/systemd.nix
https://github.com/arianvp/server-optimised-nixos/blob/master/modules/stage-1.nix#L84-L114
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#80038 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE365CHAOGS2RTBZUF4Z5DR7JZJVANCNFSM4KUYCWEQ>
.
|
No downsides as of yet. It's just not complete yet. Indeed generators are the next item on my list. |
I finally 0001-Start-device-units-for-uninitialised-encrypted-devic.patchThis only removes a single udev rule from 0002-Don-t-try-to-unmount-nix-or-nix-store.patchThis adds 0003-Fix-NixOS-containers.patchThe commit message says that NixOS containers bind-mount the init script into It's not entirely certain if this was a bug once and got fixed in the meantime. Simply patching these checks out entirely is not what we should do. 0004-Look-for-fsck-in-the-right-place.patchThere have been quite some refactorings going on recently in systemd w.r.t Given these calls are dispatched through Same could apply for 0005-Add-some-NixOS-specific-unit-directories.patchSome of the removals here are mostly insignificant "performance optimizations" The addition of The Dysnomia-specific path Maybe both Dysnomia and 0006-Get-rid-of-a-useless-message-in-user-sessions.patchThis seems to workaround some (superfluous? annoying?) log lines about We'd need to check if that's a side-effect of 0007-hostnamed-localed-timedated-disable-methods-that-cha.patchThis lets above tools immediately bail out if you want to change something that Most of the code afterwards should still provide somewhat meaningful error Once the upstream code does handle it nicely, we could drop this patch. 0008-Fix-hwdb-paths.patchRemoves a bunch of (FHS) lookup paths from systemd, not sure about what it 0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patchWould need to be kept, of some sort, given we don't assemble things in Interestingly, this also patches documentation, contrary to We might be able to upstream a patch making 0010-localectl-use-etc-X11-xkb-for-list-x11.patchSame here, changes 0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patchThis could probably become unnecessary by setting 0012-Install-default-configuration-into-out-share-factory.patch
0013-inherit-systemd-environment-when-calling-generators.patchMaybe I misunderstand something else from what this is doing, but this could 0014-add-rootprefix-to-lookup-dir-paths.patchWe'd probably need to keep this patch. It'd be good to see what else relies on 0015-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patchThis might be useful upstream as well, and once it's added to the docs could be 0016-systemd-sleep-execute-scripts-in-etc-systemd-system-.patchSame as 0017-kmod-static-nodes.service-Update-ConditionFileNotEmp.patchPretty NixOS-specific. 0018-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patchI'd love for this to be configurable from meson, but it seems systemd currently |
About patch 0009: This discussion in the systemd-devel mailing list seems related: https://lists.freedesktop.org/archives/systemd-devel/2020-September/045265.html |
Some comments regarding patch 0005:
Maybe I misunderstand the intention of the patch, but I think doesn't work. For instance, try: nix-env -iA mpd-mpris
systemctl --user daemon-reload
systemctl --user cat mpd-mpris.service Gives the error:
Where: ls -l ~/.nix-profile/lib/systemd/user/ Shows the service file is there. But, if you: ln -s ~/.nix-profile/lib/systemd/user ~/.local/share/systemd
systemctl --user daemon-reload I.e follow this, suddenly this: systemctl --user cat mpd-mpris.service Prints the service file content, as expected. I'm currently documenting the behavior of current Systemd in NixOS in #98661 , and I think there's more information to put there, and I don't see any evidence that this patch does something, please correct me if I'm wrong. If I'm not, I think it'd be best to remove the patch and give better documentation instead.
I have never heard of the path -
Besides that, I agree with all of the statements regarding upstreaming patches. 💚 @flokli. |
|
The lack of tests and documentation on this makes me wonder whether it's really widely used, and whether we shouldn't just drop it…
No, but NixOS could provide some glue code activation script symlinking things from the system profile to |
I did dig a bit further, apparently "switch user" not shown in the start bar is fixed in "Switch User" not being visible in the lockscreen seems to have a similar cause, but we apparently never reported this upstream to plasma (or no-one did link to it at least, I don't know). I'd much prefer applying a plasma patch that upstream already has in master over adding more patches to systemd. And I feel like we also haven't reported back to systemd they accidentially made a public dbus method private (if that's what happened), and whether it can be reverted in a What about (on unstable) dropping |
I marked this as stale due to inactivity. → More info |
Not stale you stupid bot.
…On 18 June 2021 23:44:42 CEST, "stale[bot]" ***@***.***> wrote:
I marked this as stale due to inactivity. → [More
info](https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#80038 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I marked this as stale due to inactivity. → More info |
Still not stale :) |
Could we do a round-up again on our current patches? |
Currently, our release process of a new systemd version is quite complicated.
This is mostly due to the fact that we apply a lot of patches on top of systemd upstream (currently 27!).
We currently track those in a custom https://github.com/nixos/systemd fork of systemd, which is very hard to maintain.
systemd-stable
, and we don't want to rewrite history on pushed branches either.Ideally, we'd end up with like 4-5 downstream patches, have upstreamed the others in a more generic fashion, or just handled differently.
I pushed a WIP of that effort to https://github.com/flokli/nixpkgs/commits/systemd-mainline, would be happy to see some helping hands.
cc @andir @edolstra @Mic92 @arianvp
The text was updated successfully, but these errors were encountered: