I'm using DietPi on a pi Zero for a project that requires it to boot asap. I have some scripts I want to execute immediately once the pi is started, and the faster it can get to rc.local and execute the scripts the better. Are there any ways of optimizing the boot time? I've increased the ARM Initial Turbo setting in dietpi-config to 60 (max). It now takes about 50 seconds to boot and run, which honestly is kind of a long boot time.
Any suggestions of unneeded startup items to remove? Any better way of executing startup scripts, e.g. creating a service out of it, perhaps? But I don't know if it will execute earlier than putting it in rc.local...
Any suggestions are welcome!
Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
4 posts • Page 1 of 1
Hi,dietpifan wrote:It now takes about 50 seconds to boot and run, which honestly is kind of a long boot time.
This is far too long, should be < 20 seconds, is this with or without your additional script being executed?
One the main culprits is WiFi and DHCP, try using a static IP for the adapter to improve boot times.
Service would be ideal. Can you link the script your running? i'll take a look.Any better way of executing startup scripts, e.g. creating a service out of it, perhaps?
Good to heardietpifan wrote:I created a service out of it and now it takes less than 20secs until SSH becomes available! I'm surprised it made that much of a difference.
SystemD launches threads for services when not using type=oneshot, (eg: starts 10+ services at once) would explain the improved boot time.