Skip to content

lib/tmpfiles.d: symlink networks, protocols, rpc and services into /etc - #44

Merged
dongsupark merged 1 commit into
flatcar:flatcar-masterfrom
satwiksps:fix-missing-nss-files
Aug 7, 2026
Merged

lib/tmpfiles.d: symlink networks, protocols, rpc and services into /etc#44
dongsupark merged 1 commit into
flatcar:flatcar-masterfrom
satwiksps:fix-missing-nss-files

Conversation

@satwiksps

@satwiksps satwiksps commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

/etc/protocols, /etc/services, /etc/rpc and /etc/networks are not on disk in flatcar. Glibc finds them under /usr/share/baselayout/ through the usrfiles NSS module wired up in nsswitch.conf, so getprotobyname() and friends work fine and nothing looks broken.

Anything that opens those paths directly does break though. Statically linked binaries and go programs parse /etc/protocols themselves, and kubernetes workloads that mount the file as a hostPath with type: File do not even start, because kubelet requires the path to exist on the host, this is what azure-npm runs into.

So this PR adds four L lines to baselayout-etc.conf pointing back at the copies in /usr/share/baselayout/, exactly how /etc/nsswitch.conf and /etc/issue are already handled. L leaves an existing path alone, so anyone who put their own file in /etc keeps it.

@satwiksps
satwiksps requested a review from a team as a code owner July 28, 2026 09:03
glibc resolves these through the usrfiles NSS module, so nothing in
/etc is needed for getprotobyname() and friends to work. Anything that
reads the paths directly still breaks though: statically linked
binaries open /etc/protocols themselves, and a hostPath volume of type
File keeps kubelet from starting the pod at all when the file is
missing, which is what azure-npm hits on Flatcar.

Link them from /usr/share/baselayout the same way /etc/nsswitch.conf
already is. tmpfiles leaves an existing path alone, so a copy the user
put there keeps winning.

Fixes flatcar/Flatcar#1852

Signed-off-by: Satwik Sai Prakash Sahoo <sahoospsatwik@gmail.com>
@satwiksps
satwiksps force-pushed the fix-missing-nss-files branch from d888f8a to a84fe9f Compare August 6, 2026 01:28
@satwiksps satwiksps changed the title tmpfiles.d: Symlink nss files (protocols, services, rpc, networks) into /etc/ lib/tmpfiles.d: symlink networks, protocols, rpc and services into /etc Aug 6, 2026
@dongsupark

Copy link
Copy Markdown
Member

Thanks, created a PR flatcar/scripts#4190, running CI.

@dongsupark dongsupark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI passed

@dongsupark
dongsupark merged commit 509343f into flatcar:flatcar-master Aug 7, 2026
1 check passed
dongsupark added a commit to flatcar/scripts that referenced this pull request Aug 7, 2026
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.

/etc/protocols file is missing on Flatcar despite existing as /usr/share/baselayout/protocols

2 participants