-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Rely on systemd-tmpfiles and remove some privileged startup logic in resolved & networkd #6241
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
Conversation
Remove CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER from the capability bounding set.
The /run/network/netif directory and those under are created by systemd-tmpfiles from systemd.conf. Remove CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER from the capability bounding set.
|
systemd-networkd is |
|
Indeed the s390x autopkgtest has plenty of errors because networkd is started too early: And many more such messages. |
|
While I sympasize with the goal, I am not this can be really done for early-boot services like resolved and networkd. It might be possible to make this work with RuntimeDirectory= though, that definitely deserves some looking into, but tmpfiles can't really work, afaics. RuntimeDirectory= as it is designed right now is not a great fit either, but I think we could relatively easily make it one. Specifically, /run/network and friends are supposed to survive restarts of networkd (as we use them to serialize state). Maybe we could tweak RuntimeDirectory= a bit, bit adding some single-character modifier or so, which would permit configuring a directory that is created on first service start if missing but is not automatically removed. Maybe a syntax like this: i.e. using Does that make sense? |
This is #6087 . TBH I prefer the |
|
Yupp, #6087 appears like the right way out for this. It would be excellent if this PR could be reworked to implement that, so that we can reduce the priviliged code in resolved+networkd but also not require tmpfiles |
|
Thanks for the feedback. I'll look into it. |
|
I have pushed an alternative version of this PR as #6393. |
|
Closing this one in favour of #6393 |
The systemd-resolved & systemd-networkd daemons re-create folders in /run/systemd that have already been created by systemd-tmpfiles during bootup from tpmfiles.d/systemd.conf.
Remove this duplicate logic and add a missing directory entry for networkd. Also remove associated capabilities required by those operations.
This is a first step to non-root startup of those daemons. A first try is available at Siosm/systemd@unpriv-resolved-networkd, but requires ambient capability from a recent kernel (>4.3) thus I have split the PR in two.