You are not logged in.
Pages: 1
I have a computer lab with several diskless clients, which boot from the same server and exported root. So that each client has a unique machine-id, I had symlinked /etc/machine-id to /run/machine-id, as documented in this post.
After a recent upgrade, this has stopped working. The problem seems to be that systemd no longer supports symlinks for /etc/machine-id, as discussed in this bug report.
Anyone have ideas for workarounds?
To help people searching, the clients stopped booting. They got stuck in a loop between "Started D-Bus System Message Bus" and "Starting D-Bus System Message Bus." Deleting the symlink from /etc/machine-id to /run/machine-id fixed the problem, and the clients boot again. But then they don't have unique machine-id's anymore. Restoring the symlink and running `systemd-machine-id-setup` yields the error, "Cannot create '/etc/machine-id': File exists".
Offline
In which way do the diskless clients differ ?
Is the hardware all the same, incl. same MAC ?
If yes, how would it be possible for on OS to distinguish between them, and assign always the same IP as you wish ?
https://man.archlinux.org/man/machine-id.5.en
lists some ways, incl. kernel command line parameter for the ID. Could this help ?
Offline
systemd no longer supports symlinks for /etc/machine-id … Anyone have ideas for workarounds?
Tried a bind mount?
https://man.archlinux.org/man/mount.8#B … _operation
( You can bind mount a file to a file because everything's a file
)
Offline
In which way do the diskless clients differ ?
Is the hardware all the same, incl. same MAC ?
If yes, how would it be possible for on OS to distinguish between them, and assign always the same IP as you wish ?https://man.archlinux.org/man/machine-id.5.en
lists some ways, incl. kernel command line parameter for the ID. Could this help ?
Each client has a different MAC address. On the server, under /srv/arch/boot/pxelinux.cfg/, I have a different PXELINUX configuration file for each MAC address, and each configuration file uses the systemd.machine_id kernel parameter to set a different machine-id for each client. This worked fine before when systemd permitted symlinks for /etc/machine-id to /run/machine-id, as each client would save their unique machine-id to a tmpfs. But the symlink approach doesn't work anymore.
Offline
When I read correct, you can use the "APPEND" in a PXELINUX configuration file to add kernel command line parameters. Plus:
The machine ID may be set, for example when network booting, with the systemd.machine_id= kernel command line parameter or by passing the option --machine-id= to systemd. An ID specified in this manner has higher priority and will be used instead of the ID stored in /etc/machine-id.
quote from my link above. I don't understand, why you need to symlink anything ? Due to the priority, kernel command line parameter wins ?
Last edited by ua4000 (2026-03-31 17:06:27)
Offline
When I read correct, you can use the "APPEND" in a PXELINUX configuration file to add kernel command line parameters. Plus:
The machine ID may be set, for example when network booting, with the systemd.machine_id= kernel command line parameter or by passing the option --machine-id= to systemd. An ID specified in this manner has higher priority and will be used instead of the ID stored in /etc/machine-id.
quote from my link above. I don't understand, why you need to symlink anything ? Due to the priority, kernel command line parameter wins ?
When I boot a client, it writes its machine id, specified by a kernel command line parameter, to /etc/machine-id. When I boot a second client, it overwrites /etc/machine-id with its machine id, also specified by a kernel command line parameter. So, /etc/machine-id always has the machine id of the most recently booted client.
Is there a way to view a machine's machine-id other than viewing the contents of /etc/machine-id? I think hostnamectl just pulls from /etc/machine-id, for example.
If an early-boot client has a machine id, specified by a kernel command line parameter, that differs from what is in /etc/machine-id because it was overwritten by a later-boot client, will that cause any issues? Does every process that uses the machine-id follow what's described in the man page for machine-id, i.e., use the machine-id specified in --machine-id rather than the file /etc/machine-id?
Thanks for all your help!
Offline
systemd no longer supports symlinks for /etc/machine-id … Anyone have ideas for workarounds?
Tried a bind mount?
https://man.archlinux.org/man/mount.8#B … _operation
( You can bind mount a file to a file because everything's a file)
I'm not sure exactly what to bind mount to what, or how to do it during the client boot process. Presumably, the client would have to do it as a part of its boot process, along with generating the machine-id. Perhaps /usr/lib/systemd/system/systemd-machine-id-commit.service can be copied to /etc/systemd/system/systemd-machine-id-commit.service.d/ and then modified?
Offline
You can use a bind mount more or less like a link (but unlike w/ a symlink, both files have to exist) and use just an fstab entry for that.
cd /tmp
touch foo
echo snafu > bar
sudo mount --bind foo bar
echo foobar > foo
cat bar
sudo umount bar
cat barOffline
You can use a bind mount more or less like a link (but unlike w/ a symlink, both files have to exist) and use just an fstab entry for that.
Thanks for your help. In /srv/arch/etc/fstab (i.e., the clients' fstab), I added the following line:
/run/machine-id /etc/machine-id none defaults,bind 0 0I made an empty file /srv/arch/run/machine-id, but it doesn't make it to the clients when the clients mount a tmpfs to /run. Then, when it tries to do the bind mount, /run/machine-id doesn't exist, and it fails.
Any ideas?
Offline
W/ /run/machine-id you'll not be able to use the fstab unless you're maybe getting away w/ https://wiki.archlinux.org/title/Fstab# … th_systemd
Otherwise you'll have to use a service that provides the mount once /run/machine-id shows up.
Offline
Pages: 1