LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-03-2018, 03:21 AM   #1
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Rep: Reputation: 287Reputation: 287Reputation: 287
Post 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.

testing:
One can follow the rfkill status with:
Code:
# watch -n .5 rfkill list
and operate the rfkill hardware toggle.

solution:
file:/etc/modprobe.d/rfkill.conf
Code:
options rfkill master_switch_mode=1
options rfkill default_state=0
the behavior can be further changed, but i was contended with just "restore" so hence the "1"

FWIW

Last edited by SCerovec; 09-04-2018 at 04:03 AM. Reason: typo on "toggle"
 
Old 09-06-2018, 12:07 PM   #2
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
I wonder why this thread keeps popping out as not read to me?
 
Old 09-06-2018, 12:12 PM   #3
Gordie
Member
 
Registered: Aug 2007
Posts: 428

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by SCerovec View Post
I wonder why this thread keeps popping out as not read to me?
Until it is replied to that appears to be how things work
 
1 members found this post helpful.
Old 09-13-2018, 07:51 AM   #4
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
I'm still getting an soft rfkill on occasion.

Can't see in the logs what's causing it.
 
Old 09-20-2018, 03:45 AM   #5
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
So far I found out i can detect an event passing over udev whan I enable "debug" in /etc/udev/udev.conf.

It was not TLP's fault.

Stay tuned...
 
Old 09-20-2018, 03:49 PM   #6
jostber
Member
 
Registered: Jul 2001
Location: Skien, Norway
Distribution: Slackware 14.2 64-bit
Posts: 457

Rep: Reputation: 142Reputation: 142
Can you run these commands and provide the output?

Code:
rfkill list all

rfkill unblock all
 
Old 09-20-2018, 04:25 PM   #7
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 746

Rep: Reputation: Disabled
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.
 
Old 09-21-2018, 04:33 AM   #8
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
Post

Quote:
Originally Posted by jostber View Post
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...

Last edited by SCerovec; 09-21-2018 at 04:39 AM.
 
Old 09-21-2018, 04:38 AM   #9
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
Arrow gremlins!

@jostber

Code:
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
 
Old 09-22-2018, 06:50 AM   #10
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
Lightbulb heavy tools

okay pulled out the heavy tools:
fil: /etc/udev/rules.d/50-rfkill.rules
Code:
#####
#
# preventing soft block
#
####

KERNEL=="rfkill", RUN+="/usr/local/sbin/rfkillhandler"
the handler:
file: /usr/local/sbin/rfkillhandler
Code:
#!/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)
 
Old 09-24-2018, 02:33 PM   #11
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-14.2
Posts: 268

Rep: Reputation: 109Reputation: 109
I modified rc.inet1

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
 
1 members found this post helpful.
Old 09-24-2018, 05:15 PM   #12
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
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
 
Old 11-06-2018, 04:21 AM   #13
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,353
Blog Entries: 2

Original Poster
Rep: Reputation: 287Reputation: 287Reputation: 287
FWIW:
It kicks regularly in about 7-8 minutes after switching to battery operation.

Despite all the measures taken.
 
  


Reply

Tags
modprobe, netwoking, rfkill software block


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rfkill (software but not hardware) block bluetooth saves battery? stozi Linux - Newbie 1 10-12-2016 03:41 PM
RFkill is killing me, no wifi, soft block, Debian Wheezy, RTL8187 Rich3077 Linux - Newbie 13 07-29-2015 01:10 PM
Valid characters in /sys/class/rfkill/rfkill[0-9]+/name l0p3n Linux - Kernel 1 07-25-2015 10:30 AM
RFKill randomly disabled my wireless controller (soft disable) MostViktorious Linux - Networking 0 03-18-2013 12:45 AM
Soft wireless switch eremini Linux - Laptop and Netbook 1 06-25-2008 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration