brandflake11 / Retropie-Airplane-Mode

A collection of scripts to allow for disabling and enabling wireless capabilities for Linux, specifically for Retropie.
GNU General Public License v3.0
2 stars 2 forks source link

Startup time when airplane mode is enabled #2

Open a7hybnj2 opened 3 years ago

a7hybnj2 commented 3 years ago

I am sure you have noticed that the startup time is much slower when airplane mode is enabled because all the network services have to wait to timeout.

I don't exactly know where to look but I am sure there is a way to change the timeout duration before the system moves on. So, in the event that airplane mode is on you could change those values. Then change them back when you turn it off.

I will see what I can find.

a7hybnj2 commented 3 years ago

I ran a systemd-analyze plot on the boot process with airplane mode on and off. airplane_on-plot.svg.pdf airplane_off-plot.svg.pdf

brandflake11 commented 3 years ago

Interesting, I had no idea systemd did this kind of thing. I'll see if this is something we want to edit or not. If it boots much faster then sure, let's go for it. We'll just need to test it and see. I want to make sure we don't break anyone's wireless, so we'll need to test it!

Here is a page I found that has the solution to editing the timeout: https://unix.stackexchange.com/questions/227017/how-to-change-systemd-service-timeout-value#276785

Another sed command is in our future I see. :) If you get a chance to test it and it's much faster let me know! I don't know what a sane value for the timeout would be.

a7hybnj2 commented 3 years ago

I have ended up turning airplane mode off when I shutdown to avoid the additional boot times. If we cannot figure out how to adjust the timeouts I would think adding "turn off airplane" to the safe-shutdown script. If that is something that can even be done.

brandflake11 commented 3 years ago

If you would test that solution that I posted above, that would be great. However, if you don't have time, I understand too. This issue is my last priority issue, everything else will come first, as I don't experience a long boot time because of rfkill. I try to play with this though!