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

systemd: Add patch to split networkd tmpfiles into a separate file #2832

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

zmrow
Copy link
Contributor

@zmrow zmrow commented Feb 24, 2023

Issue number:
Related to #2741 and #2449

Description of changes:
It appears I missed some files when I made the networkd subpackage in systemd. These tmpfiles should only be included if the networkd subpackage is included. An upstream patch moves these entries into a separate file for situations such as this, so we include that patch.

The offending journal entries that tipped us off to this mistake looked like:

Feb 24 18:36:39 localhost systemd-tmpfiles[1562]: /x86_64-bottlerocket-linux-gnu/sys-root/usr/lib/tmpfiles.d
/systemd.conf:18: Failed to resolve user 'systemd-network': No such process
    systemd: Add patch to split networkd tmpfiles into a separate file
    
    This commit adds an upstream patch that moves systemd-networkd tmpfiles
    entries into a separate file.  This makes it simpler to include/exclude
    these tmpfiles depending on the inclusion of the networkd subpackage.
    
    The systemd.spec has been updated to exclude this new file, while the
    networkd subpackage explicitly includes it

Testing done:

  • Build and boot an aws-k8s-1.24 variant and ensure no messages referring to systemd-network's tmpfiles show up in the journal.
bash-5.1# journalctl | grep -i systemd-network                                                                                                   
bash-5.1# journalctl | grep -i networkd       
bash-5.1#
  • Build and boot an aws-dev variant with the systemd-networkd image-feature enabled (and add a dependency on console-getty.service in preconfigured.target since I knew early boot services will fail). Observe the systemd-networkd tmpfiles being created properly and no other networkd-related issues in the journal:
bash-5.1# ls -lah /run/systemd/netif/
total 4.0K
drwxr-xr-x.  5 systemd-network systemd-network 120 Feb 24 21:32 .
drwxr-xr-x. 20 root            root            540 Feb 24 21:32 ..
drwxr-xr-x.  2 systemd-network systemd-network  40 Feb 24 21:32 leases
drwxr-xr-x.  2 systemd-network systemd-network  80 Feb 24 21:32 links
drwxr-xr-x.  2 systemd-network systemd-network  40 Feb 24 21:32 lldp
-rw-r--r--.  1 systemd-network systemd-network 135 Feb 24 21:32 state

bash-5.1# journalctl | grep -i systemd-network
Feb 24 21:32:34 localhost systemd-sysusers[315]: Creating group 'systemd-network' with GID 981.
Feb 24 21:32:34 localhost systemd-sysusers[315]: Creating user 'systemd-network' (systemd Network Management) with UID 981 and GID 981.
Feb 24 21:32:35 localhost systemd-tmpfiles[894]: Reading config file "/x86_64-bottlerocket-linux-gnu/sys-root/usr/lib/tmpfiles.d/systemd-network.conf"…
...

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This commit adds an upstream patch that moves systemd-networkd tmpfiles
entries into a separate file.  This makes it simpler to include/exclude
these tmpfiles depending on the inclusion of the networkd subpackage.

The systemd.spec has been updated to exclude this new file, while the
networkd subpackage explicitly includes it.
Copy link
Contributor

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@bcressey
Copy link
Contributor

I'm OK with a patch for this but we could also just include sysusers.d/systemd-network.conf in the main package so that the user gets created.

@zmrow zmrow merged commit 4cf756f into bottlerocket-os:develop Feb 27, 2023
@zmrow zmrow deleted the networkd-tmpfiles branch February 27, 2023 18:13
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.

5 participants