WiFi start script problems
Hello, I've got some problems with my WiFi start script: 1. From time to time it just «looses» the connection, so I have to manually reconnect it with `/etc/rc.d/wifi restart`; 2. From time to time it doesn't reconnect on my laptop wake-up after suspend; 2. dhcpcd processes aren't properly killed, so after the days of using (and dozens of wifi restarts) I see lots of running processes with `ps ax | grep dhcpcd`. My /etc/rc.d/wifi script is the following: #!/bin/sh # # /etc/rc.d/wifi: start/stop wireless network # case $1 in start) # loopback /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host /sbin/ip link set lo up # wireless /sbin/ip link set wlan0 up /usr/sbin/wpa_supplicant -B -iwlan0 -c/etc/wpa.conf /sbin/dhcpcd -t 30 -h $HOSTNAME wlan0 ;; stop) /sbin/dhcpcd -x rm -f /var/run/dhcpcd-wlan0.pid /sbin/ip link set lo down /sbin/ip addr del 127.0.0.1/8 dev lo /sbin/ip link set wlan0 down /usr/bin/killall -q /usr/sbin/wpa_supplicant rm -f /var/run/wpa_supplicant/wlan0 ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac Thanks! -- Petr Shevtsov
Which WiFi card/dongle do you use? Use lsusb or lspci and post the results. Sounds like you will need to compile a new kernel. This is my WiFi script: #!/bin/sh # # /etc/rc.d/net: start/stop wireless network (wpa 1/2) # case $1 in start) # loopback /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host /sbin/ip link set lo up # wpa 1/2 wireless with dhcp /usr/sbin/wpa_supplicant -B -D nl80211 -i wlan0 -c /etc/wifi.conf /sbin/dhcpcd wlan0 ;; stop) /usr/bin/killall -q /sbin/dhcpcd /usr/bin/killall -q /usr/sbin/wpa_supplicant /sbin/ip link set lo down /sbin/ip addr del 127.0.0.1/8 dev lo ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac # End of file -- Rex <bjorn@krstarica.com> On Sun, 23 Mar 2014 14:11:57 +0700 Petr Shevtsov <petr.shevtsov@gmail.com> wrote:
Hello,
I've got some problems with my WiFi start script:
1. From time to time it just «looses» the connection, so I have to manually reconnect it with `/etc/rc.d/wifi restart`; 2. From time to time it doesn't reconnect on my laptop wake-up after suspend; 2. dhcpcd processes aren't properly killed, so after the days of using (and dozens of wifi restarts) I see lots of running processes with `ps ax | grep dhcpcd`.
My /etc/rc.d/wifi script is the following:
#!/bin/sh # # /etc/rc.d/wifi: start/stop wireless network #
case $1 in start) # loopback /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host /sbin/ip link set lo up # wireless /sbin/ip link set wlan0 up /usr/sbin/wpa_supplicant -B -iwlan0 -c/etc/wpa.conf /sbin/dhcpcd -t 30 -h $HOSTNAME wlan0 ;; stop) /sbin/dhcpcd -x rm -f /var/run/dhcpcd-wlan0.pid /sbin/ip link set lo down /sbin/ip addr del 127.0.0.1/8 dev lo /sbin/ip link set wlan0 down /usr/bin/killall -q /usr/sbin/wpa_supplicant rm -f /var/run/wpa_supplicant/wlan0 ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac
Thanks!
-- Petr Shevtsov _______________________________________________ CRUX mailing list CRUX@lists.crux.nu http://lists.crux.nu/mailman/listinfo/crux
$ lspci 00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05) 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05) 00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5) 00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5) 00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5) 00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5) 00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05) 00:1f.0 ISA bridge: Intel Corporation HM67 Express Chipset Family LPC Controller (rev 05) 00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05) 00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05) 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05) 09:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01) -- Petr Shevtsov 23.03.2014, 16:05, "Rex" <bjorn@krstarica.com>:
Which WiFi card/dongle do you use? Use lsusb or lspci and post the results. Sounds like you will need to compile a new kernel.
This is my WiFi script:
#!/bin/sh # # /etc/rc.d/net: start/stop wireless network (wpa 1/2) #
case $1 in start) # loopback /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host /sbin/ip link set lo up # wpa 1/2 wireless with dhcp /usr/sbin/wpa_supplicant -B -D nl80211 -i wlan0 -c /etc/wifi.conf /sbin/dhcpcd wlan0 ;; stop) /usr/bin/killall -q /sbin/dhcpcd /usr/bin/killall -q /usr/sbin/wpa_supplicant /sbin/ip link set lo down /sbin/ip addr del 127.0.0.1/8 dev lo ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac
# End of file
-- Rex <bjorn@krstarica.com>
On Sun, 23 Mar 2014 14:11:57 +0700 Petr Shevtsov <petr.shevtsov@gmail.com> wrote:
Hello,
I've got some problems with my WiFi start script:
1. From time to time it just «looses» the connection, so I have to manually reconnect it with `/etc/rc.d/wifi restart`; 2. From time to time it doesn't reconnect on my laptop wake-up after suspend; 2. dhcpcd processes aren't properly killed, so after the days of using (and dozens of wifi restarts) I see lots of running processes with `ps ax | grep dhcpcd`.
My /etc/rc.d/wifi script is the following:
#!/bin/sh # # /etc/rc.d/wifi: start/stop wireless network #
case $1 in start) # loopback /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host /sbin/ip link set lo up # wireless /sbin/ip link set wlan0 up /usr/sbin/wpa_supplicant -B -iwlan0 -c/etc/wpa.conf /sbin/dhcpcd -t 30 -h $HOSTNAME wlan0 ;; stop) /sbin/dhcpcd -x rm -f /var/run/dhcpcd-wlan0.pid /sbin/ip link set lo down /sbin/ip addr del 127.0.0.1/8 dev lo /sbin/ip link set wlan0 down /usr/bin/killall -q /usr/sbin/wpa_supplicant rm -f /var/run/wpa_supplicant/wlan0 ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac
Thanks!
-- Petr Shevtsov _______________________________________________ CRUX mailing list CRUX@lists.crux.nu http://lists.crux.nu/mailman/listinfo/crux
_______________________________________________ CRUX mailing list CRUX@lists.crux.nu http://lists.crux.nu/mailman/listinfo/crux
participants (2)
-
Petr Shevtsov
-
Rex