Booting Ubuntu (on Z930) in “flight mode”

I would prefer to boot in “flight mode” — that is, all wireless devices turned off. I know where and how to turn them on (or at least, I think I do ;-). Plus, I’d prefer to, by default, save battery. (In that respect, I need to find out how to start with the brightness turned down a bit :s).

So far, this seems a hassle – every time I turn on the laptop, I’m greeted with a prompt for a WiFi password. Adding rfkill block all in /etc/rc.local/ (as suggested on various sites) doesn’t work.

Apparently, there are two independent processes that both can switch WiFi on during boot. You read that correctly: there are two processes which are independent, each of which sets the state of WiFi on boot. (to be precise: rfkill restore and networkmanager. They both try to recreate the setting they stored from last time – which can be conflicting.)

This gives a race condition. To address, you can create two scripts in /etc/init/: one to change the saved states of these processes, and one to run before either starts.
Hope this works!

*edit* hmmmmms. After reboot, no WiFi popup…. but also no NetworkManager running. So plugging in Ethernet does not work — I need to start NetworkManager myself.

Probable cause (from stackoverflow):

The ‘start on’ section lets you know which events need to be emitted before upstart will start network-manager.
In this case it’s:
– local-filesystems
– dbus
– static-network-up
Odds are the first two have already been emitted if you have booted to a desktop.

static-network-up is emitted by the /etc/network/if-up.d/upstart script, crucially, the event will not be emitted unless every interface configured as ‘auto’ in /etc/network/interfaces is up.

Trying to fix this by adding service network-manager start to rc.local…

*edit2*: that didn’t help. I’ve played around a bit and reverted to rfkill only. For some reason, the race condition worked out in my favour the last few times – likely because I manually switched off wireless, so both processes stored all wireless states as “off” now…

Comments are closed.