页次: 1
树莓派运行archlinuxarm,使用无线网卡作软AP,配置完成后通过hostapd /etc/hostapd/hostapd.conf命令测试可以正常运行。然后,设置一个.service来让其开机自动运行,出现开机运行大概90秒后无线网卡灯熄灭,通过systemctl查看faild了,在之前的90秒内查看是active(显示为activating)的. .service和脚本文件如下:
/etc/systemd/system/myhostapd.service内容如下:
[Unit]
Description=Turn on hostap
Wants=network.target
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/myhostapd
[Install]
WantedBy=multi-user.target
/usr/bin/myhostapd内容如下:
#!/bin/sh
hostapd /etc/hostapd/hostapd.conf
请问各位大神,是哪里在出了问题,本人新手!
离线
看一下journal里面有什么没?
离线
journalctl -u myhostapd.service 查看到如下:
-- Reboot --
Jan 13 07:33:17 alarmpi systemd[1]: Starting Turn on hostap...
Jan 13 07:35:08 alarmpi systemd[1]: myhostapd.service start operation timed out. Terminating.
Jan 13 07:35:08 alarmpi myhostapd[131]: Configuration file: /etc/hostapd/hostapd.conf
Jan 13 07:35:08 alarmpi myhostapd[131]: drv->ifindex=3
Jan 13 07:35:08 alarmpi myhostapd[131]: l2_sock_recv==l2_sock_xmit=0x0x14b2078
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_rts_threshold, rts=2347
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_frag_threshold, frag=2346
Jan 13 07:35:08 alarmpi myhostapd[131]: +rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_key_ops
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_key_ops
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_key_ops
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_key_ops
Jan 13 07:35:08 alarmpi myhostapd[131]: Using interface wlan0 with hwaddr e8:4e:06:**:**.** and ssid 'Arch'
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_wps_assoc_resp_ie
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_wps_beacon_ie
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_wps_probe_resp_ie
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_key_ops
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_beacon_ops
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_hidden_ssid ignore_broadcast_ssid:0, Arch,4
Jan 13 07:35:08 alarmpi myhostapd[131]: rtl871x_set_acl
Jan 13 07:35:08 alarmpi myhostapd[131]: +rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
Jan 13 07:35:08 alarmpi myhostapd[131]: ELOOP: remaining socket: sock=6 eloop_data=0x14b15e8 user_data=(nil) handler=0x324f8
Jan 13 07:35:08 alarmpi systemd[1]: Failed to start Turn on hostap.
Jan 13 07:35:08 alarmpi systemd[1]: Unit myhostapd.service entered failed state.
Jan 13 07:35:08 alarmpi systemd[1]: myhostapd.service failed.
离线
Type=forking 但是你没给 -B 参数。
要么加 -B 要么改成 Type=simple。
在线
多谢“百合仙子”!搞定了!
离线
页次: 1