systemd 总是崩溃,只有硬重置才能解决问题

systemd 总是崩溃,只有硬重置才能解决问题

在 ubuntu 21.10 上尝试时,apt full-upgrade我看到了类似的错误

Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)

$ systemctl --version
systemd 248 (248.3-1ubuntu8)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP -LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

这个问题并不总是会发生。但是一旦出现此问题,恢复 systemd 的唯一方法就是进行硬重启。

查看系统日志发现 systemd 已中止。

$ grep --text "21:35:23" /var/log/syslog
Nov 25 21:35:23 codex systemd[1]: Reloading D-Bus System Message Bus.
Nov 25 21:35:23 codex dbus-daemon[1251]: Unknown group "power" in message bus configuration file
Nov 25 21:35:23 codex dbus-daemon[1251]: [system] Reloaded configuration
Nov 25 21:35:23 codex dbus-send[12703]: method return time=1637886923.578624 sender=org.freedesktop.DBus -> destination=:1.124 serial=3 reply_serial=2
Nov 25 21:35:23 codex systemd[1]: Reloaded D-Bus System Message Bus.
Nov 25 21:35:23 codex systemd[8278]: app-gnome-bitcoin-8669.scope: Deactivated successfully.
Nov 25 21:35:23 codex systemd[1]: Reloading.
Nov 25 21:35:23 codex systemd[1]: Assertion 'hashmap_isempty(m->jobs)' failed at src/core/manager.c:1335, function manager_clear_jobs_and_units(). Aborting.
Nov 25 21:35:23 codex systemd[1]: Caught <ABRT>, dumped core as pid 12710.
Nov 25 21:35:23 codex systemd[1]: Freezing execution.

busctl输出如下所示

    $ busctl
NAME                                   PID PROCESS         USER             CONNECTION    UNIT                          SESSION DESCRIPTION
:1.1                                  1237 systemd-timesyn systemd-timesync :1.1          systemd-timesyncd.service     -       -          
:1.100                                8331 gdm-x-session   leo              :1.100        session-3.scope               3       -          
:1.101                                8476 gnome-session-b leo              :1.101        [email protected]             -       -          
:1.102                                8495 gnome-shell     leo              :1.102        [email protected]             -       -          
:1.107                                8569 evolution-calen leo              :1.107        [email protected]             -       -          
:1.108                                8583 evolution-addre leo              :1.108        [email protected]             -       -          
:1.11                                 1909 avahi-daemon    avahi            :1.11         avahi-daemon.service          -       -          
:1.110                                8634 gsd-rfkill      leo              :1.110        [email protected]             -       -          
:1.111                                8637 gsd-sharing     leo              :1.111        [email protected]             -       -          
:1.112                                8642 gsd-usb-protect leo              :1.112        [email protected]             -       -          
:1.113                                8613 gsd-color       leo              :1.113        [email protected]             -       -          
:1.114                                8680 gsd-disk-utilit leo              :1.114        [email protected]             -       -          
:1.116                                8625 gsd-keyboard    leo              :1.116        [email protected]             -       -          
:1.117                                8631 gsd-power       leo              :1.117        [email protected]             -       -          
:1.118                                8628 gsd-media-keys  leo              :1.118        [email protected]             -       -          
:1.119                                8633 gsd-print-notif leo              :1.119        [email protected]             -       -          
:1.12                                 1930 power-profiles- root             :1.12         power-profiles-daemon.service -       -          
:1.120                                8742 gsd-printer     leo              :1.120        [email protected]             -       -          
:1.13                                 2056 switcheroo-cont root             :1.13         switcheroo-control.service    -       -          
:1.14                                 2058 systemd-logind  root             :1.14         systemd-logind.service        -       -          
:1.15                                 2041 ModemManager    root             :1.15         ModemManager.service          -       -          
:1.16                                 1985 systemd-resolve systemd-resolve  :1.16         systemd-resolved.service      -       -          
:1.17                                 1960 cupsd           root             :1.17         cups.service                  -       -          
:1.181                               30657 deja-dup-monito leo              :1.181        [email protected]             -       -          
:1.19                                 2191 colord          colord           :1.19         colord.service                -       -          
:1.2                                  1252 NetworkManager  root             :1.2          NetworkManager.service        -       -          
:1.20                                 1926 networkd-dispat root             :1.20         networkd-dispatcher.service   -       -          
:1.21                                 2130 unattended-upgr root             :1.21         unattended-upgrades.service   -       -          
:1.23                                 1960 cupsd           root             :1.23         cups.service                  -       -          
:1.234                              373268 atom            leo              :1.234        [email protected]             -       -          
:1.235                              390042 busctl          leo              :1.235        [email protected]             -       -          
:1.24                                 2345 dbus            lp               :1.24         cups.service                  -       -          
:1.25                                 2344 dbus            lp               :1.25         cups.service                  -       -          
:1.26                                 2343 dbus            lp               :1.26         cups.service                  -       -          
:1.27                                 2342 dbus            lp               :1.27         cups.service                  -       -          
:1.29                                 2042 firewalld       root             :1.29         firewalld.service             -       -          
:1.30                                 2359 bluetoothd      root             :1.30         bluetooth.service             -       -          
:1.36                                 6578 kerneloops      kernoops         :1.36         kerneloops.service            -       -          
:1.37                                 6555 whoopsie        whoopsie         :1.37         whoopsie.service              -       -          
:1.38                                 6604 kerneloops      kernoops         :1.38         kerneloops.service            -       -          
:1.39                                 6555 whoopsie        whoopsie         :1.39         whoopsie.service              -       -          
:1.40                                 6638 gdm3            root             :1.40         gdm.service                   -       -          
:1.43                                 6692 smbd            root             :1.43         smbd.service                  -       -          
:1.48                                 6749 rtkit-daemon    root             :1.48         rtkit-daemon.service          -       -          
:1.53                                 6892 upowerd         root             :1.53         upower.service                -       -          
:1.54                                 6517 dockerd         root             :1.54         docker.service                -       -          
:1.6                                  1724 wpa_supplicant  root             :1.6          wpa_supplicant.service        -       -          
:1.63                                 7946 packagekitd     root             :1.63         packagekit.service            -       -          
:1.7                                  1929 polkitd         root             :1.7          polkit.service                -       -          
:1.77                                 8221 gdm-session-wor root             :1.77         session-3.scope               3       -          
:1.8                                  1957 accounts-daemon root             :1.8          accounts-daemon.service       -       -          
:1.80                                 8278 systemd         leo              :1.80         [email protected]             -       -          
:1.81                                 8285 pipewire        leo              :1.81         [email protected]             -       -          
:1.82                                 8286 pipewire-media- leo              :1.82         [email protected]             -       -          
:1.84                                 8295 gnome-keyring-d leo              :1.84         session-3.scope               3       -          
:1.85                                 8287 pulseaudio      leo              :1.85         [email protected]             -       -          
:1.89                                 8327 gvfs-udisks2-vo leo              :1.89         [email protected]             -       -          
:1.9                                  1995 udisksd         root             :1.9          udisks2.service               -       -          
:1.90                                 8333 Xorg            root             :1.90         session-3.scope               3       -          
:1.91                                 8340 goa-daemon      leo              :1.91         [email protected]             -       -          
:1.92                                 8316 tracker-miner-f leo              :1.92         [email protected]             -       -          
:1.94                                 6516 cups-browsed    root             :1.94         cups-browsed.service          -       -          
:1.95                                 6516 cups-browsed    root             :1.95         cups-browsed.service          -       -          
com.hp.hplip                             - -               -                (activatable) -                             -       -          
com.redhat.NewPrinterNotification     8742 gsd-printer     leo              :1.120        [email protected]             -       -          
com.redhat.PrinterDriversInstaller    8742 gsd-printer     leo              :1.120        [email protected]             -       -          
com.ubuntu.LanguageSelector              - -               -                (activatable) -                             -       -          
com.ubuntu.SoftwareProperties            - -               -                (activatable) -                             -       -          
com.ubuntu.USBCreator                    - -               -                (activatable) -                             -       -          
com.ubuntu.WhoopsiePreferences           - -               -                (activatable) -                             -       -          
fi.w1.wpa_supplicant1                 1724 wpa_supplicant  root             :1.6          wpa_supplicant.service        -       -          
io.netplan.Netplan                       - -               -                (activatable) -                             -       -          
net.hadess.PowerProfiles              1930 power-profiles- root             :1.12         power-profiles-daemon.service -       -          
net.hadess.SwitcherooControl          2056 switcheroo-cont root             :1.13         switcheroo-control.service    -       -          
net.reactivated.Fprint                   - -               -                (activatable) -                             -       -          
org.bluez                             2359 bluetoothd      root             :1.30         bluetooth.service             -       -          
org.debian.apt                           - -               -                (activatable) -                             -       -          
org.fedoraproject.FirewallD1          2042 firewalld       root             :1.29         firewalld.service             -       -          
org.freedesktop.Accounts              1957 accounts-daemon root             :1.8          accounts-daemon.service       -       -          
org.freedesktop.Avahi                 1909 avahi-daemon    avahi            :1.11         avahi-daemon.service          -       -          
org.freedesktop.ColorManager          2191 colord          colord           :1.19         colord.service                -       -          
org.freedesktop.DBus                     1 systemd         root             -             init.scope                    -       -          
org.freedesktop.GeoClue2                 - -               -                (activatable) -                             -       -          
org.freedesktop.ModemManager1         2041 ModemManager    root             :1.15         ModemManager.service          -       -          
org.freedesktop.NetworkManager        1252 NetworkManager  root             :1.2          NetworkManager.service        -       -          
org.freedesktop.PackageKit            7946 packagekitd     root             :1.63         packagekit.service            -       -          
org.freedesktop.PolicyKit1            1929 polkitd         root             :1.7          polkit.service                -       -          
org.freedesktop.RealtimeKit1          6749 rtkit-daemon    root             :1.48         rtkit-daemon.service          -       -          
org.freedesktop.UDisks2               1995 udisksd         root             :1.9          udisks2.service               -       -          
org.freedesktop.UPower                6892 upowerd         root             :1.53         upower.service                -       -          
org.freedesktop.bolt                     - -               -                (activatable) -                             -       -          
org.freedesktop.fwupd                    - -               -                (activatable) -                             -       -          
org.freedesktop.hostname1                - -               -                (activatable) -                             -       -          
org.freedesktop.locale1                  - -               -                (activatable) -                             -       -          
org.freedesktop.login1                2058 systemd-logind  root             :1.14         systemd-logind.service        -       -          
org.freedesktop.network1                 - -               -                (activatable) -                             -       -          
org.freedesktop.nm_dispatcher            - -               -                (activatable) -                             -       -          
org.freedesktop.resolve1              1985 systemd-resolve systemd-resolve  :1.16         systemd-resolved.service      -       -          
org.freedesktop.systemd1                 - -               -                (activatable) -                             -       -          
org.freedesktop.thermald                 - -               -                (activatable) -                             -       -          
org.freedesktop.timedate1                - -               -                (activatable) -                             -       -          
org.freedesktop.timesync1             1237 systemd-timesyn systemd-timesync :1.1          systemd-timesyncd.service     -       -          
org.gnome.DisplayManager              6638 gdm3            root             :1.40         gdm.service                   -       -          
org.opensuse.CupsPkHelper.Mechanism      - -               -                (activatable) -                             -       -          

这个问题看起来类似于systemd但这显然与我应该修复的问题不一样。

我在升级到 Ubuntu 21.10 之前也遇到过这个问题,但它自己就消失了(我想不用我去修复它)。

相关内容