# Pastebin mlAOGSGg Started as user zyga from the terminal in gnome shell session on Fedora 31, using the run-in-scope helper produced below: 0) the helper run-in-scope, used for non-service workloads: #!/bin/sh -e busctl $(test $(id -u) -eq 0 || echo --user) call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager StartTransientUnit 'ssa(sv)a(sa(sv))' testing.$(cat /proc/sys/kernel/random/uuid).scope fail 1 PIDs au 1 $BASHPID 0 exec "$@" 1) moving bash running in gnome-terminal to a scope: [zyga@fedora31 ~]$ time busctl --user call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager StartTransientUnit 'ssa(sv)a(sa(sv))' testing.$(cat /proc/sys/kernel/random/uuid).scope fail 1 PIDs au 1 $BASHPID 0 [zyga@fedora31 ~]$ cat /proc/self/cgroup 0::/user.slice/user-1000.slice/user@1000.service/testing.cd8f04c3-56d2-425a-a74a-0693440a78a3.scope [zyga@fedora31 ~]$ ls -ld /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/testing.cd8f04c3-56d2-425a-a74a-0693440a78a3.scope drwxr-xr-x. 2 zyga zyga 0 11-07 17:01 /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/testing.cd8f04c3-56d2-425a-a74a-0693440a78a3.scope 2) starting firefox from the terminal via run-in-scope [zyga@fedora31 ~]$ run-in-scope firefox o "/org/freedesktop/systemd1/job/749" [zyga@fedora31 ~]$ pgrep firefox 4416 [zyga@fedora31 ~]$ cat /proc/4416/cgroup 0::/user.slice/user-1000.slice/user@1000.service/testing.724938bf-1d80-4f85-826c-eafb20f773c4.scope [zyga@fedora31 ~]$ ls -ld /sys/fs/cgroup//user.slice/user-1000.slice/user@1000.service/testing.724938bf-1d80-4f85-826c-eafb20f773c4.scope drwxr-xr-x. 2 zyga zyga 0 11-07 17:10 /sys/fs/cgroup//user.slice/user-1000.slice/user@1000.service/testing.724938bf-1d80-4f85-826c-eafb20f773c4.scope 3) starting a service without run-in-scope [zyga@fedora31 ~]$ sudo systemctl start sleep.service [zyga@fedora31 ~]$ systemctl status sleep.service ● sleep.service Loaded: loaded (/etc/systemd/system/sleep.service; disabled; vendor preset: > Active: active (running) since Thu 2019-11-07 17:15:02 CET; 2s ago Main PID: 4933 (sleep) Tasks: 1 (limit: 9477) Memory: 332.0K CPU: 2ms CGroup: /system.slice/sleep.service └─4933 /usr/bin/sleep 1h lis 07 17:15:02 fedora31 systemd[1]: Started sleep.service. [zyga@fedora31 ~]$ cat /proc/4933/cgroup 0::/system.slice/sleep.service [zyga@fedora31 ~]$ ls -ld /sys/fs/cgroup//system.slice/sleep.service drwxr-xr-x. 2 root root 0 11-07 17:15 /sys/fs/cgroup//system.slice/sleep.service 4) service using run-in-scope [zyga@fedora31 ~]$ systemctl status sleep.service ● sleep.service Loaded: loaded (/etc/systemd/system/sleep.service; disabled; vendor preset: > Active: active (running) since Thu 2019-11-07 17:30:40 CET; 2s ago Main PID: 5723 (sleep) Tasks: 0 (limit: 9477) Memory: 752.0K CPU: 9ms CGroup: /system.slice/sleep.service ‣ 5723 /usr/bin/sleep 1h [zyga@fedora31 ~]$ cat /proc/5723/cgroup 0::/system.slice/testing.fff74326-e5c4-433e-b105-af74b2dad09b.scope NOTE: Did systemd steal a service from itself? There's a discrepancy between systemctl status and proc/[pid]/cgroup.