我可以使用访客连接访问邻居的 Wlan。信号很弱,有时我会失去互联网连接。我接受了这一点。但 wpa_supplicant 在我的日志中填满了
wpa_supplicant[983]: wlan0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-78 noise=9999 txrate=1000
我查看了手册页,找到了选项 -q (安静),然后我写了一个覆盖
systemctl edit wpa_supplicant.service
并将 Exec 更改为
ExecStart=/sbin/wpa_supplicant -q -u -s -O /run/wpa_supplicant
但重新加载 systemd 规则并从服务重新启动后,我得到了
wpa_supplicant.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
太棒了。我该如何实现我的目标?我真的必须操纵原始文件吗?
首先感谢。然后我得到
sudo systemctl status wpa_supplicant.service
● wpa_supplicant.service - WPA supplicant
Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/wpa_supplicant.service.d
└─override.conf
Active: active (running) since Sun 2019-09-29 15:43:26 CEST; 10s ago
Main PID: 5023 (wpa_supplicant)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/wpa_supplicant.service
└─5023 /sbin/wpa_supplicant -q -u -s -O /run/wpa_supplicant
Sep 29 15:43:26 beelzemon systemd[1]: Starting WPA supplicant...
Sep 29 15:43:26 beelzemon systemd[1]: Started WPA supplicant.
Sep 29 15:43:26 beelzemon wpa_supplicant[5023]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
Sep 29 15:43:26 beelzemon wpa_supplicant[5023]: dbus: Failed to construct signal
如果有什么值得关注的事情,我会指出。
答案1
systemd
不允许您修改 ExecStart 行。但是,它允许您使用空指令“重置” ExecStart 参数:
ExecStart=
ExecStart=/sbin/wpa_supplicant -q -u -s -O /run/wpa_supplicant
例如这里。ExecStart 实际上是内存中的一个数组;第一个指令清空该数组。