-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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-firstboot fails with "Failed to write /etc/hostname: Bad file descriptor" #29137
Comments
any chance you can reproduce this in strace? or at least get us logs of the precise output? |
I did reduce the command to just https://gist.github.com/NekkoDroid/36824ba3e282172ebbbb932af0578082 The entire output of that command was just |
hmm, wtf:
we just operated on fd 4 but /proc/553/fd/4 suddently doesn't exist anymore? how could that possibly be? My educated guess is that this is fall-out from 4419735, i.e. #28829. But how come your version even has that commit? that's long post v255, and cosmetic only, so should never have been backported. |
So this is probably because we set ProtectProc=invisible for hostnamed, which apparently mans |
This is even backported to v252-stable... |
just out of curiousity: how come it is able to write the other files like vconsole and locale that are before it, but consistently only fails once the hostname is to be written? |
You may want to have a look at my comment in archlinux at https://bugs.archlinux.org/task/79619 Summarizing it seems to be caused by arch-chroot, that is creating a new PID namespace but leaving the /proc mounted from the root namespace. If my analysis is correct, it's not a system but a arch linux issue. |
It mostly makes sense to me. What I am wondering now is what could be done to in theory not have to have reverted the commit?
Or am I overthinking it and this revert/initial patch doesn't have any major/minor benefit to it. |
IMHO the reverted commit is the right QUICK FIX. Long term I would suggest Arch linux fixes arch-chroot to mount /proc with chroot NS. Hoping this does not brake anything else, as you correctly stated. After that the commit in systemd can be re-applied |
This morning my system failed to boot (using |
well, as things stand now, unless you remount procfs within the arch-chroot, you cannot install arch till they either bump to 254.3 or make the arch-chroot behavior match. i emailed the systemd package maintainer and the arch bugzilla people have made enough noise to bump the issue to the top 3, hopefully something gets done soon. |
systemd version the issue has been seen with
254.2
Used distribution
Arch Linux
Linux kernel version used
6.4.7-arch1-1
CPU architectures issue was seen on
x86_64
Component
other
Expected behaviour you didn't see
Systemd-firstboot runs successfully without error writing to file
Unexpected behaviour you saw
Successfully runs up to entering the hostname, but fails to write hostname to
/etc/hostname
with "Bad file descriptor"Steps to reproduce the problem
This is on a freshly installed & chroot'd system
systemd-firstboot --prompt --reset
Additional program output to the terminal or log subsystem illustrating the issue
(not specifically logs) I have manually downgraded systemd to 254.1 and run the command again and it seems to still work with that specific version.
The text was updated successfully, but these errors were encountered: