Posted by peterhoeg on Wed 27 Jul 2005 at 20:42
Several people have written guides on booting Debian systems faster. Most of these involve reordering initscripts, and other significant changes. There is a much simpler alternative to speeding up boot times though, whilst it might not work for all it's an interesting hack.
A simple one-line hack is to run scripts in parallel, merely by changing the startup script /etc/init.d/rc.
Changing the line:
startup $i start
to the following:
startup $i start &
This idea originated here.
NOTE:This is no longer applicable when using systemd which already does a stellar job at running things as quickly as possible.
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
... echo "Loading kernel for kexec()" /usr/local/sbin/kexec \ --load /vmlinuz \ --command-line="root=301" \ --append="root=301 panic=5" echo -n "Deactivating swap..." ...and kexec the kernel in /etc/init.d/reboot:
PATH=/sbin:/bin:/usr/sbin:/usr/bin echo -n "Rebooting... " /usr/local/sbin/kexec -e reboot -d -f -i
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
startup $ACTION $SCRIPTSwith:
startup $ACTION $SCRIPTS &?
[ Parent ]
I am not using etch myself, but give it a go. It seems like shutdown sequences also will be done in parallel this way which may or may not be a good thing.
You can modify your script to look like this:
if [ "$ACTION" == "start" ] ; then startup start $SCRIPTS & else startup $ACTION $SCRIPTS fi
Untested but it should work.
[ Parent ]
[ Parent ]
[ Parent ]
# Specify method used to enable concurrent init.d scripts.so in your /etc/init.d/rc just replace:
# Valid options are 'none', 'shell' and 'startpar'
CONCURRENCY=nonewith:
CONCURRENCY=shellthis change reduced boot time on a debian/sid, Pentium III, 600MHz, runninig kernel 2.6.16-2-686 from 245 seconds to 205 seconds. i should note, not sure why, but kernel 2.6.16 boots extremly slow on this machine: 205 seconds isn't exactly fast. but other kernels boot much faster.
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
Some services assume that some other services are already up and running. With your proposal this can no longer be guaranteered. This services may now fail or not fail depending if everything starts in the right order.
I am not saying, that this is really a bad idea, but it can break things in non-obvious ways and you should know about that before doing that
[ Parent ]