Hi Luca, Sorry, for late reply, below is a log with debug. This time I run with a user with higher UID, but the result is the same.
root@host:~# systemd-analyze set-log-level debug root@host:~# systemctl set-environment XDG_RUNTIME_DIR="/run/user/1001" root@host:~# systemctl start [email protected] Job for [email protected] failed because the control process exited with error code. See "systemctl status [email protected]" and "journalctl -xeu [email protected]" for details. root@host:~# journalctl -xeu [email protected] Dec 08 09:35:53 host systemd[1]: /usr/lib/systemd/system/[email protected]:19: Support for option PAMName= has been disabled at compile time and it is ignored Dec 08 09:35:53 host systemd[1]: [email protected]: Trying to enqueue job [email protected]/start/replace Dec 08 09:35:53 host systemd[1]: [email protected]: Installed new job [email protected]/start as 6724 Dec 08 09:35:53 host systemd[1]: [email protected]: Enqueued job [email protected]/start as 6724 Dec 08 09:35:53 host systemd[1]: [email protected]: starting held back, waiting for: [email protected] Dec 08 09:35:54 host systemd[1]: [email protected]: Will spawn child (service_enter_start): /usr/lib/systemd/systemd Dec 08 09:35:54 host systemd[1]: [email protected]: Failed to set 'memory.zswap.max' attribute on '/user.slice/user-1001.slice/[email protected]' to 'max': No such file or directory Dec 08 09:35:54 host systemd[1]: [email protected]: Passing 0 fds to service Dec 08 09:35:54 host systemd[1]: [email protected]: About to execute: /usr/lib/systemd/systemd --user Dec 08 09:35:54 host systemd[1]: [email protected]: Forked /usr/lib/systemd/systemd as 6899 Dec 08 09:35:54 host (systemd)[6899]: Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy Dec 08 09:35:54 host systemd[1]: [email protected]: Changed dead -> start Dec 08 09:35:54 host systemd[1]: Starting User Manager for UID 1001... Dec 08 09:35:54 host (systemd)[6899]: Bind-mounting / on /run/systemd/mount-rootfs (MS_BIND|MS_REC "")... Dec 08 09:35:54 host systemd[1]: [email protected]: User lookup succeeded: uid=1001 gid=118 Dec 08 09:35:54 host (systemd)[6899]: Applying namespace mount on /run/systemd/mount-rootfs/run/credentials Dec 08 09:35:54 host (systemd)[6899]: Bind-mounting /run/systemd/inaccessible/dir on /run/systemd/mount-rootfs/run/credentials (MS_BIND|MS_REC "")... Dec 08 09:35:54 host (systemd)[6899]: Successfully mounted /run/systemd/inaccessible/dir to /run/systemd/mount-rootfs/run/credentials Dec 08 09:35:54 host (systemd)[6899]: Applying namespace mount on /run/systemd/mount-rootfs/run/systemd/incoming Dec 08 09:35:54 host (systemd)[6899]: Followed source symlinks /run/systemd/propagate/[email protected] → /run/systemd/propagate/[email protected]. Dec 08 09:35:54 host (systemd)[6899]: Bind-mounting /run/systemd/propagate/[email protected] on /run/systemd/mount-rootfs/run/systemd/incoming (MS_BIND "")... Dec 08 09:35:54 host (systemd)[6899]: Successfully mounted /run/systemd/propagate/[email protected] to /run/systemd/mount-rootfs/run/systemd/incoming Dec 08 09:35:54 host (systemd)[6899]: Applying namespace mount on /run/systemd/mount-rootfs/sys Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy Dec 08 09:35:54 host (systemd)[6899]: Mounting sysfs (sysfs) on /run/systemd/mount-rootfs/sys (MS_NOSUID|MS_NODEV|MS_NOEXEC "")... Dec 08 09:35:54 host (systemd)[6899]: [email protected]: Executing: /usr/lib/systemd/systemd --user Dec 08 09:35:54 host systemd[6899]: Failed to copy os-release for propagation, ignoring: Permission denied Dec 08 09:35:54 host systemd[6899]: Failed to allocate manager object: Permission denied Dec 08 09:35:54 host systemd[1]: [email protected]: Got notification message from PID 6899 (ERRNO=13) Dec 08 09:35:54 host systemd[1]: [email protected]: Got notification message from PID 6899 (EXIT_STATUS=1) Dec 08 09:35:54 host systemd[1]: [email protected]: Child 6899 belongs to [email protected]. Dec 08 09:35:54 host systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE Dec 08 09:35:54 host systemd[1]: [email protected]: Failed with result 'exit-code'. Dec 08 09:35:54 host systemd[1]: [email protected]: Service will not restart (restart setting) Dec 08 09:35:54 host systemd[1]: [email protected]: Changed start -> failed Dec 08 09:35:54 host systemd[1]: [email protected]: Job 6724 [email protected]/start finished, result=failed Dec 08 09:35:54 host systemd[1]: Failed to start User Manager for UID 1001. Dec 08 09:35:54 host systemd[1]: [email protected]: Unit entered failed state. Dec 08 09:35:54 host systemd[1]: [email protected]: Consumed 63ms CPU time. Dec 08 09:35:54 host systemd[1]: [email protected]: Releasing resources... Best regards, Christopher Wong From: Luca Boccassi <[email protected]> Date: Wednesday, 6 December 2023 at 17:46 To: Christopher Wong <[email protected]> Cc: [email protected] <[email protected]> Subject: Re: [systemd-devel] Manual start of user@<uid>.service failed with permission denied On Wed, 6 Dec 2023 at 16:00, Christopher Wong <[email protected]> wrote: > Hi, > > I’m trying to do the following: > > root@host:~# systemctl set-environment XDG_RUNTIME_DIR="/run/user/503" Why are you setting this? Anyway, enable debug level log and attach the output, otherwise it's hard to say
