在我的 Ubuntu 18.04.1 系统上,systemd 的用户管理器无法启动。我认为这是我当前遇到的其他问题的根本原因。有什么想法可以摆脱这个吗?
\n\n系统版本
\n\n$ systemd --version\nsystemd 237\n+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid\nRun Code Online (Sandbox Code Playgroud)\n\nUbuntu 18.04.1 LTS 版本
\n\n$ uname -a\nLinux example.com 4.15.0 #1 SMP Wed Jul 25 19:09:31 MSK 2018 x86_64 x86_64 x86_64 GNU/Linux\nRun Code Online (Sandbox Code Playgroud)\n\nsystemctl 单元状态
\n\n $ sudo systemctl status user@1001.service\n\xe2\x97\x8f user@1001.service - User Manager for UID 1001\n Loaded: loaded (/lib/systemd/system/user@.service; static; vendor preset: enabled)\n Drop-In: /lib/systemd/system/user@.service.d\n \xe2\x94\x94\xe2\x94\x80timeout.conf\n Active: failed (Result: protocol) since Tue 2019-01-08 10:33:08 CET; 1min 42s ago\n Process: 315 ExecStart=/lib/systemd/systemd --user (code=exited, status=1/FAILURE)\n Main PID: 315 (code=exited, status=1/FAILURE)\n\nJan 08 10:33:08 example.com systemd[1]: Starting User Manager for UID 1001...\nJan 08 10:33:08 example.com systemd[315]: pam_unix(systemd-user:session): session opened for user mischa by (uid=0)\nJan 08 10:33:08 example.com systemd[1]: user@1001.service: Failed with result 'protocol'.\nJan 08 10:33:08 example.com systemd[1]: Failed to start User Manager for UID 1001.\nRun Code Online (Sandbox Code Playgroud)\n\n系统日志说
\n\nJan 8 10:33:08 example.com systemd[1]: Starting User Manager for UID 1001...\nJan 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\nJan 8 10:33:08 example.com systemd[315]: Failed to allocate manager object: Permission denied\nJan 8 10:33:08 example.com systemd[1]: user@1001.service: Failed with result 'protocol'.\nJan 8 10:33:08 example.com systemd[1]: Failed to start User Manager for UID 1001.\nRun Code Online (Sandbox Code Playgroud)\n\n我的用户服务单位文件
\n\n$ cat /lib/systemd/system/user@.service\n# SPDX-License-Identifier: LGPL-2.1+\n#\n# This file is part of systemd.\n#\n# systemd is free software; you can redistribute it and/or modify it\n# under the terms of the GNU Lesser General Public License as published by\n# the Free Software Foundation; either version 2.1 of the License, or\n# (at your option) any later version.\n\n[Unit]\nDescription=User Manager for UID %i\nAfter=systemd-user-sessions.service\n\n[Service]\nUser=%i\nPAMName=systemd-user\nType=notify\nExecStart=-/lib/systemd/systemd --user\nSlice=user-%i.slice\nKillMode=mixed\nDelegate=pids cpu\nTasksMax=infinity\nTimeoutStopSec=120s\nRun Code Online (Sandbox Code Playgroud)\n
升级 Ubuntu 后,我发生了这种情况...您可能需要检查以下目录链中的权限。
/sys/fs/cgroup/systemd/user.slice/user-1000.slice/
因此,您需要确保其他人具有读取和执行权限,以便您的用户可以创建该目录。对我来说,升级一定没有为/sys/fs/cgroup/systemd/设置正确的权限 ,所以我执行了以下操作:
chmod o+rx /sys/fs/cgroup/systemd/
| 归档时间: |
|
| 查看次数: |
14677 次 |
| 最近记录: |