1

On my Ubuntu 18.04.1 system the User Manager of systemd fails to start. I suppose this to be the root cause of other problems that I currently encounter. Any ideas how to get rid of this?

systemd version

$ systemd --version
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

Ubuntu 18.04.1 LTS Version

$ uname -a
Linux example.com 4.15.0 #1 SMP Wed Jul 25 19:09:31 MSK 2018 x86_64 x86_64 x86_64 GNU/Linux

systemctl unit status

 $ sudo systemctl status user@1001.service
● user@1001.service - User Manager for UID 1001
   Loaded: loaded (/lib/systemd/system/user@.service; static; vendor preset: enabled)
  Drop-In: /lib/systemd/system/user@.service.d
           └─timeout.conf
   Active: failed (Result: protocol) since Tue 2019-01-08 10:33:08 CET; 1min 42s ago
  Process: 315 ExecStart=/lib/systemd/systemd --user (code=exited, status=1/FAILURE)
 Main PID: 315 (code=exited, status=1/FAILURE)

Jan 08 10:33:08 example.com systemd[1]: Starting User Manager for UID 1001...
Jan 08 10:33:08 example.com systemd[315]: pam_unix(systemd-user:session): session opened for user mischa by (uid=0)
Jan 08 10:33:08 example.com systemd[1]: user@1001.service: Failed with result 'protocol'.
Jan 08 10:33:08 example.com systemd[1]: Failed to start User Manager for UID 1001.

The syslog says

Jan  8 10:33:08 example.com systemd[1]: Starting User Manager for UID 1001...
Jan  8 10:33:08 example.com systemd[315]: Failed to create /user.slice/user-1001.slice/user@1001.service/init.scope control group: Permission denied
Jan  8 10:33:08 example.com systemd[315]: Failed to allocate manager object: Permission denied
Jan  8 10:33:08 example.com systemd[1]: user@1001.service: Failed with result 'protocol'.
Jan  8 10:33:08 example.com systemd[1]: Failed to start User Manager for UID 1001.

My user service unit file

$ cat /lib/systemd/system/user@.service
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=User Manager for UID %i
After=systemd-user-sessions.service

[Service]
User=%i
PAMName=systemd-user
Type=notify
ExecStart=-/lib/systemd/systemd --user
Slice=user-%i.slice
KillMode=mixed
Delegate=pids cpu
TasksMax=infinity
TimeoutStopSec=120s
0

This happened to me after upgrading Ubuntu... you might want to check permissions in the following directory chain.

/sys/fs/cgroup/systemd/user.slice/user-1000.slice/

So you need to make sure other has read and execute permissions all the way up so your user can create that directory. For me, the upgrade must not have set the right permissions for /sys/fs/cgroup/systemd/ So I did the following:

chmod o+rx /sys/fs/cgroup/systemd/

  • But that directory is created on reboot. So I am trying to figure out where that permission is set. – benzeno Mar 6 at 12:06
  • Hmmm, it is true that this directory structure does not have o+rx on all directories. However, on another Ubuntu 18 system that I have access to, which does not have this problem, the permissions are exactly the same... So it must be something different? – Mischa Mar 13 at 8:17

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.