systemd user daemon fails with Permission denied when creating transient scope
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Observed on 18.04. Systemd user instance fails when trying to create a transient scope when logged in through ssh as a regular user
Specifically this fails:
$ systemd-run --user --scope ls
Job for run-rc78f932ad7
See "systemctl status run-rc78f932ad7
Inspecting journal shows:
Oct 05 10:38:16 ubuntu systemd[1437]: run-rc78f932ad7
Oct 05 10:38:16 ubuntu systemd[1437]: run-rc78f932ad7
Oct 05 10:38:16 ubuntu systemd[1437]: Failed to start /bin/ls.
Oct 05 10:38:16 ubuntu polkitd(
Further strace shows that there is an EACCES when writing the PID of the forked process to cgroup procs:
1437 openat(AT_FDCWD, "/sys/fs/
1437 newfstatat(
1437 openat(AT_FDCWD, "/sys/fs/
1437 fcntl(34, F_GETFL) = 0x8001 (flags O_WRONLY|
1437 fstat(34, {st_dev=makedev(0, 32), st_ino=2358, st_mode=
1437 write(34, "7461\n", 5) = -1 EACCES (Permission denied)
1437 close(34) = 0
Full strace of the failed attempt: https:/
When executing the same command from a gnome terminal, the scope is created successfuly. Full trace of successful execution: https:/
The relevant bit from the happy execution path:
openat(AT_FDCWD, "/sys/fs/
newfstatat(
openat(AT_FDCWD, "/sys/fs/
fcntl(34, F_GETFL) = 0x8001 (flags O_WRONLY|
fstat(34, {st_dev=makedev(0, 32), st_ino=2298, st_mode=
write(34, "7410\n", 5) = 5
close(34) = 0
23838 write(31, "24075\n", 6) = -1 EACCES (Permission denied)
$ lsb_release -rd
Description: Ubuntu 18.04.6 LTS
Release: 18.04
$ dpkg -l systemd\*
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii systemd 237-3ubuntu10.52 amd64 system and service manager
un systemd-container <none> <none> (no description available)
un systemd-shim <none> <none> (no description available)
ii systemd-sysv 237-3ubuntu10.52 amd64 system and service manager - SysV links
Possibly related: https:/ /github. com/systemd/ systemd/ issues/ 3388