wifi and bluetooth auto start at system startup

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

Hi,

could you actually post your rc.local ?
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

Code: Select all

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

rfkill block all
exit 0
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: wifi and bluetooth auto start at system startup

Post by JeremyB »

Try putting

Code: Select all

sleep 1m
above the rfkill command
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

Hi

if wifi still the problem being on at startup


replace
rfkill block all
try

Code: Select all

sudo rfkill block wlan0
to check if wifi goes of

with
rfkill block wlan0
assuming your wifi is wlan0
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

My apologies for replying late.

I tried both the tips (adding sleep 1m and adding sudo rfkill wlan0.)

The first method negated rfkill and both bluetooth and wifi were found switched on at startup.

the second method had no effect on wifi (still found switched on at startup) and bluetooth was also found switched on at startup.

There must be some configuration file of network manager in which both bluetooth and wifi have been configured to enable at startup. we must be missing that.
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

probably then let's force it

open /etc/rc.local

Code: Select all

sudo gedit /etc/rc.local
and add the following line right after the last line starting with a “#” and just before “exit 0″
dbus-send --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Set string:org.freedesktop.NetworkManager string:WirelessEnabled variant:boolean:false
Reboot
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: wifi and bluetooth auto start at system startup

Post by JeremyB »

Might need to increase the sleep to 2m to get it to work if rc.local is running to early
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

Guys I tried both workarounds to no avail. The problem still persists. I even tried combinations of the two. But nothing works. Both bluetooth and wifi are swithced on at system startup. The only command that works seems to be rfkill block all and that too on BT only...

That long string of command...to which configuration file does it point to?
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

That long string of command...to which configuration file does it point to?
it points to rc.local and tells the network-manager not to enable wifi at start :false.
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

it's not working....how do we get this pestering annoyance solved?
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

strange.
in network-manager is the wifi profile set to automatically connect as mine is? (seems to be done by default)
MASON_001-1.png
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

no it is not...for my ethernet connection it is but not for wifi.
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

running out of ideas now......
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

oh dont say that....there is something that we are overlooking......i am sure of it...we just have to keep looking.
PatH57

Re: wifi and bluetooth auto start at system startup

Post by PatH57 »

:lol: still looking.

Did you try a kernel upgrade? 3.13 has still a lot of issues ,I just upgraded mine to 3.15.11 and it fixed an annoying problem with my radeon card and fan control.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: wifi and bluetooth auto start at system startup

Post by JeremyB »

PatH57 wrote::lol: still looking.

Did you try a kernel upgrade? 3.13 has still a lot of issues ,I just upgraded mine to 3.15.11 and it fixed an annoying problem with my radeon card and fan control.
That might be the cure to make the rfkill command work in rc.local as the PC that I tested on had kernel 3.15.2
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

Hi guys,

I am reopening the thread for discussions on this recurring problem of wifi auto on at startup inspite of having added rfkill to suress bluetooth and wifi at startup. Rfkill only seems to work bluetooth, wifi still remains switched on at startup and has to be manually switched off from network applet.

I was advised to upgrade to the latest stable kernel, which i did. However the problem persists, much to my dismay.

Please advise on how to get of this annoyance.

Thank you.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: wifi and bluetooth auto start at system startup

Post by JeremyB »

My bluetooth is strange at times but I tried this and it did block my wifi

Code: Select all

gedit rfkill.sh
put this in a file

Code: Select all

#!/bin/bash
rfkill block bluetooth
rfkill block wifi
save, exit program

Code: Select all

chmod +x rfkill.sh
Then I went to the program menu, Preferences, Startup Applocations, click add, enter whatever you want for a name- I used rfkill, and for command choose browse and find the rfkill.sh in the home directory and click the add button. Reboot and see if it works
arun-mintuser

Re: wifi and bluetooth auto start at system startup

Post by arun-mintuser »

with a great deal of satisfaction I hereby announce that this problem stands solved...it worked!!!

wanted to be sure before i put up any comment. Thank you jeremy.

Now how do i hide the rfkill.sh file as I don't want it showing up in my home folder and dont want no one tampering with it (by accidently deleting it or otherwise)
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: wifi and bluetooth auto start at system startup

Post by JeremyB »

See if

Code: Select all

chattr +i rfkill.sh
works to keep it from being deleted
Locked

Return to “Networking”