我有一个名为 wificheck 的小脚本:
ifdown --force $1
sleep 4
ifup $1
在 systemd 中设置它。如果我运行它sudo ./script.sh wlan0
工作正常,但如果我运行该进程sudo systemctl start wificheck.service
,wifi接口将无法再次启动,并在journalctl日志中显示错误:
Dec 25 19:51:55 kraken.local systemd[1]: Started Wifi Check.
Dec 25 19:51:55 kraken.local systemd[1]: wificheck.service: Succeeded.
Dec 25 19:51:55 kraken.local wpa_supplicant[3244]: wlan0: CTRL-EVENT-TERMINATING
Dec 25 19:51:55 kraken.local wpa_supplicant[3244]: ioctl[SIOCSIWAP]: Operation not permitted
Dec 25 19:51:55 kraken.local wpa_supplicant[3244]: wlan0: CTRL-EVENT-DISCONNECTED bssid=50:c7:bf:f9:12:d9
Dec 25 19:51:55 kraken.local wpa_supplicant[3244]: ioctl[SIOCSIWAP]: Operation not permitted
服务是:
[Unit]
Description=Wifi Check
[Service]
Type=oneshot
ExecStart=/home/pi/scripts/wificheck wlan0
不知道接下来要检查什么。尖端?谢谢!