一次 polkit 包升级导致的滚挂问题

今天是 15 号,需要搭一个新的系统用来做测试,用了一直使用的脚本来安装后,出了问题,无法连接网络,报错信息大概是权限问题,后面重启或者其他操作也全部报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Jan 15 18:21:20 archlinux systemd[1]: polkit.service: Main process exited, code=exited, status=217/USER
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit polkit.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 217.
Jan 15 18:21:20 archlinux systemd[1]: polkit.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit polkit.service has entered the 'failed' state with result 'exit-code'.
Jan 15 18:21:20 archlinux systemd[1]: Failed to start Authorization Manager.
░░ Subject: A start job for unit polkit.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit polkit.service has finished with a failure.
░░
░░ The job identifier is 2159 and the job result is failed.
Jan 15 18:21:20 archlinux NetworkManager[609]: <info> [1736936480.2701] audit: op="connection-add-activate" pid=858 uid=1000 result="fail" reason="Not authorized to control networking."
Jan 15 18:21:25 archlinux systemd[1]: systemd-localed.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit systemd-localed.service has successfully entered the 'dead' state.

翻看错误日志,发现是 polkit 这个服务起不来,重启也不行

1
2
3
➜  ~ sudo systemctl restart polkit
Job for polkit.service failed because the control process exited with error code.
See "systemctl status polkit.service" and "journalctl -xeu polkit.service" for details.

再看包更新日志,确实更新了这个包,从 125 升到了 126

1
2
➜  ~ pacman -Q | grep polkit
polkit 126-1

怎么办呢?回滚

Arch 这个系统好就好在滚挂了能很快在 archive 里找到旧包

直接下载 125 版本的下来重新安装,然后重启服务,好了

不信邪,我测试机比较多,在另一台机上面滚一下重启,没有问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
➜  ~ sudo pacman -Syu
:: Synchronizing package databases...
core is up to date
extra is up to date
multilib is up to date
archlinuxcn 1389.5 KiB 924 KiB/s 00:02 [--------------------------------------------------------------------] 100%
:: Starting full system upgrade...
warning: conky: ignoring package upgrade (1.19.7-1 => 1.21.5-1)
warning: xfce4-terminal: ignoring package upgrade (0.8.9.2-2 => 1.1.4-1)
resolving dependencies...
looking for conflicting packages...

Package (1) Old Version New Version Net Change Download Size

extra/polkit 125-1 126-1 0.01 MiB 0.39 MiB

Total Download Size: 0.39 MiB
Total Installed Size: 1.89 MiB
Net Upgrade Size: 0.01 MiB

:: Proceed with installation? [Y/n]

难道新安装的系统有问题,旧系统升级就没问题?再来重试一遍系统安装,果然又有问题

得出结论,直接全新安装 126 包是会挂的,但是从 125 升到 126 就正常


更新:当天晚些时候,看到官方已经出了个补丁包,我试了重新安装系统测试,也是能正常了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
➜  ~ sudo pacman -Syu
:: Synchronizing package databases...
core is up to date
extra is up to date
archlinuxcn is up to date
:: Starting full system upgrade...
warning: conky: ignoring package upgrade (1.19.7-1 => 1.21.5-1)
warning: xfce4-terminal: ignoring package upgrade (0.8.9.2-2 => 1.1.4-1)
resolving dependencies...
looking for conflicting packages...

Package (1) Old Version New Version Net Change Download Size

extra/polkit 126-1 126-2 0.00 MiB 0.39 MiB

Total Download Size: 0.39 MiB
Total Installed Size: 1.89 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n]

总算明白,当时上网查这个错误怎么解决的时候,有人说,重新安装这个包解决了他的问题

我告诉你,重新安装是解决不了的,你重新安装的是打了补丁的了,包名一样,造成了你的假象