[systemd-devel] DynamicUser=yes leads to "Too many levels of symbolic links" for /etc/.pwd.lock

Muggeridge, Matt matt.muggeridge2 at hpe.com
Thu Sep 14 03:50:04 UTC 2023


Hi,

I'm using systemd-v254.

My rdisc service fails to start when "DynamicUser=yes", and the error message comes from systemd.execute.c<https://github.com/systemd/systemd-stable/blob/v254-stable/src/core/execute.c#L5019>. It's complaining about the /etc/.pwd.lock file (see journal below).

I turned on debug (systemd-analyze set-log-level debug) and then attempted to start the rdisc.service.  This is an extract from the journal:

$ journalctl -f
:

Sep 14 03:26:19 sph-093-rmc systemd[1]: rdisc.service: Forked /sbin/rdisc as 24873

Sep 14 03:26:19 sph-093-rmc (rdisc)[24873]: Cannot open /etc/.pwd.lock: Too many levels of symbolic links

Sep 14 03:26:19 sph-093-rmc (rdisc)[24873]: rdisc.service: Failed to update dynamic user credentials: Too many levels of symboli

c links

Sep 14 03:26:19 sph-093-rmc (rdisc)[24873]: rdisc.service: Failed at step USER spawning /sbin/rdisc: Too many levels of symbolic

 links

Sep 14 03:26:19 sph-093-rmc systemd[1]: Sent message type=signal sender=org.freedesktop.systemd1 destination=n/a path=/org/freed

I can override it with "DynamicUser=no" and the service starts.  However, I'm trying to understand why it reports "too many levels of symbolic links". The lock file is a single-level symlink to a file in sysconfig.  (This is an embedded device, where /etc is read-only and /etc/sysconfig is writeable).


$ ls -l /etc/.pwd.lock

lrwxrwxrwx 1 root root 19 Apr  5  2011 /etc/.pwd.lock -> sysconfig/.pwd.lock

$ ls -l /etc/sysconfig/.pwd.lock

-rw------- 1 root root 0 Aug 16 07:25 /etc/sysconfig/.pwd.lock

For the purpose of investigation, I configured an overlay so /etc/.pwd.lock was a simple writeable file (not a read-only symlink) and the service starts.

Why is systemd complaining about the file being a symlink?

Regards,
Matt.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230914/571538e9/attachment-0001.htm>


More information about the systemd-devel mailing list