我刚刚从 Ubuntu lxde 18.04 升级到 Ubuntu lxqt 20.04,遇到了 upower.service 无法正常启动的问题(在启动时以及当我尝试使用 启动服务时sudo service start upower
)。
journalctl -xe -u upower
avril 02 16:19:18 upowerd[14136]:
g_dbus_proxy_get_connection: assertion 'G_IS_DBUS_PROXY (proxy)'
failed avril 02 16:19:18 upowerd[14136]:
g_dbus_connection_signal_subscribe: assertion 'G_IS_DBUS_CONNECTION
(connection)' failed avril 02 16:19:18 upowerd[14136]:
g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)'
failed avril 02 16:19:18 upowerd[14136]: Could not
acquire inhibitor lock: Unknown reason avril 02 16:19:18
upowerd[14136]: g_dbus_proxy_get_connection: assertion
'G_IS_DBUS_PROXY (proxy)' failed avril 02 16:19:18
upowerd[14136]: g_dbus_connection_signal_unsubscribe: assertion
'G_IS_DBUS_CONNECTION (connection)' failed avril 02 16:19:18
systemd[1]: upower.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit upower.service has successfully entered the 'dead' state.
如果我以 root 身份手动启动守护进程:
sudo /usr/lib/upower/upowerd --verbose &
它工作正常。
然后我就可以启动xfce4-power-manager
或lxqt-powermanagement
以非root身份启动。
我没有改变服务的定义方式:
文件 :/lib/systemd/system/upower.service
[Unit] Description=Daemon for power management
Documentation=man:upowerd(8)
[Service] Type=dbus BusName=org.freedesktop.UPower
ExecStart=/usr/lib/upower/upowerd Restart=on-failure
# Filesystem lockdown ProtectSystem=strict
# Needed by keyboard backlight support ProtectKernelTunables=false ProtectControlGroups=true ReadWritePaths=/var/lib/upower
StateDirectory=upower ProtectHome=true PrivateTmp=true
# Network
# PrivateNetwork=true would block udev's netlink socket IPAddressDeny=any RestrictAddressFamilies=AF_UNIX AF_NETLINK
# Execute Mappings MemoryDenyWriteExecute=true
# Modules ProtectKernelModules=true
# Real-time RestrictRealtime=true
# Privilege escalation NoNewPrivileges=true
# Capabilities CapabilityBoundingSet=
# System call interfaces LockPersonality=yes SystemCallArchitectures=native SystemCallFilter=@system-service
SystemCallFilter=ioprio_get
# Namespaces PrivateUsers=yes RestrictNamespaces=yes
# Locked memory LimitMEMLOCK=0
[Install] WantedBy=graphical.target
我的 Ubuntu 内核版本:
uname - a
4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
编辑(感谢@David,我意识到更新过程中一定出了问题,我确实sudo apt install --install-recommends linux-generic-hwe-20.04
这样做sudo grub-set-default 0
了sudo update-grub
),现在我正在运行最新的内核,但它仍然不起作用。:
uname - a
Linux 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35
UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
您能否就如何让 upower 作为服务正确启动提供建议?谢谢