<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 8, 2023, 12:22 Christopher Wong <<a href="mailto:Christopher.Wong@axis.com">Christopher.Wong@axis.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="en-SE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="m_7169220593321645339WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Hi Luca,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">root@host:~# systemd-analyze set-log-level debug<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">root@host:~# systemctl set-environment XDG_RUNTIME_DIR="/run/user/1001"</span></p></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I'd avoid doing that globally. If you really want to have a PAM-less system, then edit the unit to set this through its Environment= instead.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="en-SE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div class="m_7169220593321645339WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">root@host:~# systemctl start user@1001.service<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Job for user@1001.service failed because the control process exited with error code.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">See "systemctl status user@1001.service" and "journalctl -xeu user@1001.service" for details.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">root@host:~# journalctl -xeu user@1001.service<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:53 host systemd[1]: /usr/lib/systemd/system/user@.service:19: Support for option PAMName= has been disabled at compile time and it is ignored<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:53 host systemd[1]: user@1001.service: Trying to enqueue job user@1001.service/start/replace<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:53 host systemd[1]: user@1001.service: Installed new job user@1001.service/start as 6724<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:53 host systemd[1]: user@1001.service: Enqueued job user@1001.service/start as 6724<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:53 host systemd[1]: user@1001.service: starting held back, waiting for: user-runtime-dir@1001.service<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Will spawn child (service_enter_start): /usr/lib/systemd/systemd<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Failed to set 'memory.zswap.max' attribute on '/user.slice/user-1001.slice/user@1001.service' to 'max': No such file or directory<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Passing 0 fds to service<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: About to execute: /usr/lib/systemd/systemd --user<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Forked /usr/lib/systemd/systemd as 6899<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Changed dead -> start<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: Starting User Manager for UID 1001...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Bind-mounting / on /run/systemd/mount-rootfs (MS_BIND|MS_REC "")...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: User lookup succeeded: uid=1001 gid=118<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Applying namespace mount on /run/systemd/mount-rootfs/run/credentials<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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 "")...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Successfully mounted /run/systemd/inaccessible/dir to /run/systemd/mount-rootfs/run/credentials<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Applying namespace mount on /run/systemd/mount-rootfs/run/systemd/incoming<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Followed source symlinks /run/systemd/propagate/user@1001.service → /run/systemd/propagate/user@1001.service.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Bind-mounting /run/systemd/propagate/user@1001.service on /run/systemd/mount-rootfs/run/systemd/incoming (MS_BIND "")...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Successfully mounted /run/systemd/propagate/user@1001.service to /run/systemd/mount-rootfs/run/systemd/incoming<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Applying namespace mount on /run/systemd/mount-rootfs/sys<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Failed to umount /run/systemd/mount-rootfs/sys, ignoring: Device or resource busy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: Mounting sysfs (sysfs) on /run/systemd/mount-rootfs/sys (MS_NOSUID|MS_NODEV|MS_NOEXEC "")...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host (systemd)[6899]: user@1001.service: Executing: /usr/lib/systemd/systemd --user<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[6899]: Failed to copy os-release for propagation, ignoring: Permission denied<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[6899]: Failed to allocate manager object: Permission denied</span></p></div></div></blockquote></div></div><div dir="auto">Try setting SYSTEMD_LOG_LEVEL=debug for the user@ service unit to see what happens here. (This is a separate instance so it doesn't inherit the debug level that pid1 has...)</div><div dir="auto"><br></div><div dir="auto">Also, I might've missed this, but does anything *create* /run/user/1001 here? Normally user-user-runtime-dir@1001.service would be the one to do so, and I see "waiting for: user-runtime-dir@1001.service" in the logs, but I don't see anything else – did that service actually succeed? is the path owned by UID 1001?</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="en-SE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div class="m_7169220593321645339WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Got notification message from PID 6899 (ERRNO=13)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Got notification message from PID 6899 (EXIT_STATUS=1)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Child 6899 belongs to user@1001.service.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Main process exited, code=exited, status=1/FAILURE<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Failed with result 'exit-code'.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Service will not restart (restart setting)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Changed start -> failed<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Job 6724 user@1001.service/start finished, result=failed<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: Failed to start User Manager for UID 1001.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Unit entered failed state.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Consumed 63ms CPU time.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Dec 08 09:35:54 host systemd[1]: user@1001.service: Releasing resources...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="SV" style="font-size:11.0pt">Best regards,<u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Christopher Wong<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<div id="m_7169220593321645339mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Luca Boccassi <<a href="mailto:luca.boccassi@gmail.com" target="_blank" rel="noreferrer">luca.boccassi@gmail.com</a>><br>
<b>Date: </b>Wednesday, 6 December 2023 at 17:46<br>
<b>To: </b>Christopher Wong <<a href="mailto:Christopher.Wong@axis.com" target="_blank" rel="noreferrer">Christopher.Wong@axis.com</a>><br>
<b>Cc: </b><a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">systemd-devel@lists.freedesktop.org</a> <<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">systemd-devel@lists.freedesktop.org</a>><br>
<b>Subject: </b>Re: [systemd-devel] Manual start of user@<uid>.service failed with permission denied<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On Wed, 6 Dec 2023 at 16:00, Christopher Wong <<a href="mailto:Christopher.Wong@axis.com" target="_blank" rel="noreferrer">Christopher.Wong@axis.com</a>> wrote:<br>
> Hi,<br>
><br>
> I’m trying to do the following:<br>
><br>
> root@host:~# systemctl set-environment XDG_RUNTIME_DIR="/run/user/503"<br>
<br>
Why are you setting this?<br>
Anyway, enable debug level log and attach the output, otherwise it's hard to say<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote></div></div></div>