2

I'm using Debian wheezy on an embedded platform (iMX.6 on Solidrun Hummingboard), and I have rfkill blocking my WiFi.

the command sudo rfkill unblock wifi works, so I've created a script called unblock_wifi.sh and put it in /etc/init.d:

#!/bin/bash

logFile=/var/log/unblock_wifi.log
timestamp=$(date +%Y%m%d_%H%M%S)

echo "unblock_wifi - Started at $timestamp" > $logFile
rfkill unblock wifi &>> $logFile

timestamp=$(date +%Y%m%d_%H%M%S)
echo  "unblock_wifi - Done at $timestamp" >> $logFile

On boot, the script is called (the log appears on /var/log and the times are correct. There is nothing but the start and stop messages) but the wifi is still blocked. If I call the script myself after boot, the wifi is enabled.

My script is on /etc/rc2.d/S05unblock_wifi.sh, and it appears last on ls, I think it means that it runs last. There's no script for rfkill though...

How does rfkill run without having a script in init.d? It probably runs after my script has ran. Where should I put my script in order for it to run after rfkill?

EDIT: I've searched all around for an answer, but everybody seems to recommend putting a script in /etc/init.d, which is what I tried

1

Are you sure it's in the right order? this question seems to say ls doesn't show the right ordering, so you might want to make sure it's loaded at the end of the other services.

1

After Timidger's comment I've set out to get a deeper understanding of the boot sequence and also found out the connman was the culprit disabling the wifi. Disabling its service did what I needed.

For future reference: The boot order is decided by the dependencies needed by each service. If you want your script to run after something - Require it as a dependency (See this question) -

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.