Xenial 上的 NetworkManager 权限错误

Xenial 上的 NetworkManager 权限错误

所以,我搞砸了。我试图在 NetworkManager 上安装 VPN 附加功能,结果不小心删除了整个服务(不知怎么回事……仍然不确定是怎么发生的)。所以我试着从头开始重新安装它。警告:我可能在这里做了一些非常愚蠢的事情——提前道歉。

我下载了 tar 包并从头开始重新构建它。重新启动计算机,看起来一切正常。但是当我尝试连接到 wifi 时,它只是挂了一会儿。运行时service NetworkManager status我看到:

● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/local/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2016-09-17 11:34:09 EDT; 31s ago
 Main PID: 2418 (NetworkManager)
   CGroup: /system.slice/NetworkManager.service
           ├─2418 /usr/local/sbin/NetworkManager --no-daemon
           └─3724 /sbin/dhclient -d -q -sf /usr/local/libexec/nm-dhcp-helper -pf /usr/local/var/run/dhclient-wlp2s0.pid -lf /usr/loc

Sep 17 11:34:26 yichijin-Lemur-Ultra dhclient[3725]: execve (/usr/local/libexec/nm-dhcp-helper, ...): Permission denied
Sep 17 11:34:26 yichijin-Lemur-Ultra dhclient[3724]: DHCPDISCOVER on wlp2s0 to 255.255.255.255 port 67 interval 3 (xid=0xf46a306b)
Sep 17 11:34:26 yichijin-Lemur-Ultra dhclient[3724]: Can't create /usr/local/var/run/dhclient-wlp2s0.pid: Read-only file system
Sep 17 11:34:29 yichijin-Lemur-Ultra dhclient[3724]: DHCPDISCOVER on wlp2s0 to 255.255.255.255 port 67 interval 4 (xid=0xf46a306b)
Sep 17 11:34:30 yichijin-Lemur-Ultra dhclient[3724]: DHCPREQUEST of 192.168.1.146 on wlp2s0 to 255.255.255.255 port 67 (xid=0x6b306a
Sep 17 11:34:30 yichijin-Lemur-Ultra dhclient[3724]: DHCPOFFER of 192.168.1.146 from 192.168.1.1
Sep 17 11:34:30 yichijin-Lemur-Ultra dhclient[3724]: DHCPACK of 192.168.1.146 from 192.168.1.1
Sep 17 11:34:30 yichijin-Lemur-Ultra dhclient[3724]: can't create /usr/local/var/lib/NetworkManager/dhclient-b1cfa2a8-395a-4fe9-af77
Sep 17 11:34:30 yichijin-Lemur-Ultra dhclient[3724]: bound to 192.168.1.146 -- renewal in 39965 seconds.
Sep 17 11:34:30 yichijin-Lemur-Ultra dhclient[3724]: Can't create /usr/local/var/run/dhclient-wlp2s0.pid: Read-only file system

显然是某种只读权限问题。我不确定我在构建原始软件包时是否配置不正确,但我尝试从 .deb 软件包重新安装 NetworkManager,但仍然遇到同样的问题。所以当我第一次尝试重新安装时,肯定破坏了某些东西。

有人能给我指点迷津吗?我有点不知所措。

答案1

可能是因为系统的 NetworkManager.service 文件包含 ProtectSystem=true,导致 systemd 将 /usr 挂载为只读。

在构建时,您可以指定 NetworkManager 安装路径的位置,例如 /var/run。请参阅./configure --help

如果这是一次学习练习,那就太好了。否则我只会使用您的发行版提供的软件包apt-get install network-manager……

相关内容