rfkill soft blocking after hardware switch unblock - all of sudden
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
rfkill soft blocking after hardware switch unblock - all of sudden
There are similar threads, but i would not like bumping them - this didn't happen to my setup just a while back.
problem:
wifi does not work
symptoms:
when trying to start the network in /etc/rc.d the script rc.inet1 complains the RFKILL is blocking it
cause:
I accidentally flipped the RFKILL switch and suddenly all hell broke loose. Despite UN-fliping it, and rfkill ceasing the hardblock, it stubbornly raises the softblock that remains after.
Some weeks ago I installed a non Slackware distro on a Panasonic Toughbook CF-52. The BIOS ACPI table does not support Linux and there never was a BIOS update. Uninteresting to your problem description except for my cure. I had to perform a specific dance to enable the wireless. Something like this:
Code:
rmmod athk52
rmmod athk
rfkill unblock all
Flip the wireless hardware switch off.
Wait about 10 seconds.
Flip the wireless hardware switch on.
modprobe athk52
I don't know if a similar dance for your lappie will help.
Can you run these commands and provide the output?
Code:
rfkill list all
rfkill unblock all
Code:
# rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
5: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
# rfkill unblock all
bash-4.3# rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
5: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
the observed behavior is correct so far
my problem is that *something* injects the soft block for no obvious reason
and my grievance is that neither wpa_supplicant nor rc.inet1 handle the undue softblock
Insult to injury, NetworkManager handles it in a breeze, but alas, i resorted to wpa_supplicant as the only one being able to connect to an weird issue on my personal wlan.
So here I am seeking the culprit.
I had some tiny progress lately, too early to report, stay tuned...
bash-4.3# rfkill list all <flipped the rfkill switch to OFF>
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: yes
5: (null): Bluetooth
Soft blocked: yes
Hard blocked: no
bash-4.3# rfkill list all <still the rfkill switch is OFF>
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: yes
bash-4.3# rfkill unblock all <still the rfkill switch is OFF>
bash-4.3# rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
bash-4.3# rfkill list all <flipped the rfkill switch to ON>
0: phy0: Wireless LAN
Soft blocked: yes < gremlins! >
Hard blocked: no
6: hci0: Bluetooth
Soft blocked: yes < gremlins! >
Hard blocked: no
bash-4.3# rfkill unblock all
bash-4.3# rfkill list all
0: phy0: Wireless LAN
Soft blocked: no <still the rfkill switch is ON>
Hard blocked: no
6: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
and occasional "injection" of soft block during normal operation
#!/bin/bash
TIME=$(/bin/date +%H:%M:%S)
STATUS="skipped"
LOGFILE=/var/log/rfkillhandler
touch $LOGFILE
PARENT=$(ps $PPID)
declare -a IDX
declare -a SOFT
declare -a HARD
IFS=$'\t\n'
S=$(rfkill list all)
IFS=$' \t\n'
c=-1
LOGGER() {
echo $TIME "[rfkillhandler]: action:["$ACTION"<"$PARENT"] - " $STATUS >> $LOGFILE
}
if [ $ACTION != 'change' ]; then
STATUS="ignored"
LOGGER
exit 0
fi
# to skip splitting over space
IFS=$'\t\n'
for a in $S
do
if [ "${a:1:1}" == ":" ]; then
c=$(( $c + 1 ))
#echo "index:$c"
#the index
IDX[$c]=${a:0:1}
else
# the states
#echo "testing [${a:0:12}]"
if [ "${a:0:12}" == "Soft blocked" ]; then
x=${a:13}
#echo "softblock:$x"
SOFT[c]=$x
fi
if [ "${a:0:12}" == "Hard blocked" ]; then
x=${a:13}
#echo "hardblock:$x"
HARD[c]=$x
fi
fi
done
# restoring
IFS=$' \t\n'
STATUS="parsed [$r]"
for (( r=0 ; r <= $c ; r++))
do
#echo "hardblock: [${HARD[$r]}]"
if [ "${HARD[$r]}" == " no" ]; then
if [ "${SOFT[r]}" == " yes" ]; then
rfkill unblock ${IDX[r]}
STATUS="unblocked:["${IDX[r]}"]"
else
STATUS="skipped:["${IDX[r]}"]"
fi
else
echo "hardblocked : yes"
STATUS="hardblocked:["${IDX[r]}"]"
fi
LOGGER
done
STATUS="checked [$r]"
LOGGER
exit 0
it remains to be seen if it will remedy the soft lock (works so far)
It is interesting to see the different approaches to solving the softblock issue. SCerovec's udev / handler solution was way more elaborate than what I did: I modified rc.inet1, adding the /usr/sbin/rfkill unblock all, and have never had a pesky soft block since--would be nice to figure out what the cause of these soft blocks are though...
Code:
#! /bin/sh
# /etc/rc.d/rc.inet1
# This script is used to bring up the various network interfaces.
#
# @(#)/etc/rc.d/rc.inet1 10.2 Sun Jul 24 12:45:56 PDT 2005 (pjv)
##############################
# UNBLOCK NETWORK INTERFACES #
##############################
/usr/sbin/rfkill unblock all
############################
# READ NETWORK CONFIG FILE #
############################
# Get the configuration information from /etc/rc.d/rc.inet1.conf:
. /etc/rc.d/rc.inet1.conf
I must admit i still have an icon bound on the launcher that issues the rfkill unblock all, and it happens that i still have to resort to it - less often than before...
that rfkill belongs there, wish PV would put it there one day
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.