3

I'm on Debian 11, on a Virtual Machine using kvm My user can login via console, ssh and lightdm. But there is an error with systemd

sudo systemctl status user@1000.service 
● user@1000.service - User Manager for UID 1000
     Loaded: loaded (/lib/systemd/system/user@.service; static)
    Drop-In: /lib/systemd/system/user@.service.d
             └─sysfs.conf
     Active: failed (Result: exit-code) since Mon 2021-09-06 20:20:08 UTC; 50min ago
       Docs: man:user@.service(5)
   Main PID: 897 (code=exited, status=1/FAILURE)
        CPU: 12ms

set 06 20:20:08 host systemd[1]: Starting User Manager for UID 1000...
set 06 20:20:08 host systemd[897]: pam_unix(systemd-user:session): session opened for user user(uid=1000) by (uid=0)
set 06 20:20:08 host systemd[897]: Failed to determine supported controllers: No such process
set 06 20:20:08 host systemd[897]: Failed to allocate manager object: No such process
set 06 20:20:08 host systemd[1]: user@1000.service: Main process exited, code=exited, status=1/FAILURE
set 06 20:20:08 host systemd[1]: user@1000.service: Failed with result 'exit-code'.
set 06 20:20:08 host systemd[1]: Failed to start User Manager for UID 1000.

I see the service try to exec this line

grep -i exec /lib/systemd/system/user@.service
ExecStart=/lib/systemd/systemd --user

I try to debug the service

/lib/systemd/systemd --user --log-level=debug

systemd 247.3-6 running in user mode for user 1000/user. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
Failed to create '/run/user/1000/systemd/inaccessible', ignoring: File exists
Failed to create '/run/user/1000/systemd/inaccessible/reg', ignoring: File exists
Failed to create '/run/user/1000/systemd/inaccessible/dir', ignoring: File exists
Failed to create '/run/user/1000/systemd/inaccessible/fifo', ignoring: File exists
Failed to create '/run/user/1000/systemd/inaccessible/sock', ignoring: File exists
Failed to create '/run/user/1000/systemd/inaccessible/chr', ignoring: File exists
Failed to create '/run/user/1000/systemd/inaccessible/blk', ignoring: Operation not permitted
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Failed to determine root cgroup, ignoring cgroup memory limit: No such process
RLIMIT_MEMLOCK is already as high or higher than we need it, not bumping.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Unified cgroup hierarchy is located at /sys/fs/cgroup/user.slice/user-1000.slice/session-1.scope.
Failed to create /user.slice/user-1000.slice/session-1.scope/init.scope control group: Permission denied
Failed to allocate manager object: Permission denied

Any solution?

1

1 Answer 1

2

Solution/workaround found, probably is a bug of systemd. With this cmdline on grub "systemd.unified_cgroup_hierarchy=0" all works fine

vim /etc/default/grub

GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor systemd.unified_cgroup_hierarchy=0"

update-grub2
shutdown -r now

we make some checks, all works fine as expected

systemctl is-active user@1000.service 
active
sudo systemctl list-units --state failed 
  UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
1
  • systemd.unified_cgroup_hierarchy=0 also fixed similar errors Failed to determine supported controllers: Operation not permitted / Failed to allocate manager object: Operation not permitted on systemd --user startup (occurs since upgrade from raspberry pi os buster to bullseye with hidepid=1/noaccess). what are the implications of this change? (man systemd only mentions "fall back to hybrid or full legacy cgroup hierarchy")
    – canochordo
    Jan 9 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.