Hey guys,
I am trying to get my Raspberry Pie to connect to my schools 802.1x network on startup. I have the follow script
$this->bbcode_second_pass_code('', '
#!/bin/bash
/usr/bin/rmmod 8192cu
/sbin/modprobe 8192cu
/sbin/ip link set dev wlan0 up
/usr/sbin/wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
/sbin/dhcpcd wlan0
')
It runs fine from the command line and creates an IP address that I can ssh into.
$this->bbcode_second_pass_code('', '
# /usr/lib/systemd/scripts/wireless
Successfully initialized wpa_supplicant
ioctl[SIOCSIWAP]: Operation not permitted
dhcpcd[305]: version 5.6.7 starting
dhcpcd[305]: wlan0: waiting for carrier
dhcpcd[305]: wlan0: carrier acquired
dhcpcd[305]: wlan0: sending IPv6 Router Solicitation
dhcpcd[305]: wlan0: sendmsg: Cannot assign requested address
dhcpcd[305]: wlan0: broadcasting for a lease
dhcpcd[305]: wlan0: invalid UDP packet from 192.168.2.1
dhcpcd[305]: wlan0: offered 155.246.163.204 from 155.246.151.135
dhcpcd[305]: wlan0: acknowledged 155.246.163.204 from 155.246.151.135
dhcpcd[305]: wlan0: checking for 155.246.163.204
dhcpcd[305]: wlan0: sending IPv6 Router Solicitation
dhcpcd[305]: wlan0: leased 155.246.163.204 for 3600 seconds
dhcpcd[305]: forked to background, child pid 357
')
However, I created a the following systemctl service
$this->bbcode_second_pass_code('', '
# cat /usr/lib/systemd/system/network.service
[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device
[Service]
Type=oneshot
ExecStart=/usr/lib/systemd/scripts/wireless
[Install]
WantedBy=multi-user.target
')
It fails, with the following status
$this->bbcode_second_pass_code('', '
# systemctl status network
network.service - Network Connectivity
Loaded: loaded (/usr/lib/systemd/system/network.service; enabled)
Active: inactive (dead) since Thu 1970-01-01 01:00:10 BST; 43 years 3 months ago
Process: 153 ExecStart=/usr/lib/systemd/scripts/wireless (code=killed, signal=TERM)
')
I have a feeling it has to do with the following error even though the script is still successful. Is there any way to get rid of or ignore this error.
$this->bbcode_second_pass_code('', 'ioctl[SIOCSIWAP]: Operation not permitted')