[systemd-devel] Manual start of user@<uid>.service failed with permission denied

Christopher Wong Christopher.Wong at axis.com
Wed Dec 6 14:46:11 UTC 2023


Hi,

I’m trying to do the following:

root at host:~# systemctl set-environment XDG_RUNTIME_DIR="/run/user/503"
root at host:~# systemctl start user at 503.service<mailto:user at 503.service>

On systemd 253.4, the user can be started manually, and I can list the directory:

root at host:~# ls -la /run/user/503
drwx------    3 debugar  debugar         80 Dec  4 09:08 .
drwxr-xr-x    3 root     root            60 Dec  4 09:08 ..
srw-rw-rw-    1 debugar  debugar          0 Dec  4 09:08 bus
drwxr-xr-x    4 debugar  debugar        120 Dec  4 09:08 systemd

On last systemd v254-stable and v255-stable, I got the following instead:

root at host:/var/log# journalctl -xeu user at 503.service<mailto:user at 503.service>
Dec 06 12:40:41 host systemd[1]: Starting User Manager for UID 503...
Dec 06 12:40:41 host systemd[7939]: Failed to copy os-release for propagation, ignoring: Permission denied
Dec 06 12:40:41 host systemd[7939]: Failed to allocate manager object: Permission denied
Dec 06 12:40:41 host systemd[1]: user at 503.service<mailto:user at 503.service>: Main process exited, code=exited, status=1/FAILURE
Dec 06 12:40:41 host systemd[1]: user at 503.service<mailto:user at 503.service>: Failed with result 'exit-code'.
Dec 06 12:40:41 host systemd[1]: Failed to start User Manager for UID 503.

systemd was able to create the dir /run/user/503, but got errno -13 (Permission denied) when it was trying to do mkdirat with path /run/user/503/systemd in function mkdirat_label() in file mkdir-label.c.

Do I need to do something else before starting user@<uid>.service<mailto:user@%3cuid%3e.service> or is this a bug?

Best regards,
Christopher Wong



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20231206/979b209e/attachment.htm>


More information about the systemd-devel mailing list