[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Proposed release goal: Switch to dash as /bin/sh to speed up the boot



Last summer, Carlos Villegas worked as part of the Google Summer of
Code program to improve the debian Boot process.  Part of his results
were to identify what could be done to speed up the boot system.  As
can be seen from
<URL:http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/deliverable3.html>,
the most effective single change was changing /bin/sh from bash to
dash.  The reason is that dash starts faster than bash, and the shell
is started quite a lot of times during boot.  Measurements showed that
they run equally fast, so the improved boot time must be due to dash
doing less work during initialization.

Ubuntu switched /bin/sh to dash several releases ago.  I am not sure
why, but suspect it was to speed up the boot.

Debian Edu has been using dash as /bin/sh for several years now.  The
reason for switching was not boot speed, but the fact that bash loads
libnss, which on a system using LDAP for NSS means all processes using
/bin/sh would be linked to libldap in /usr/lib/, thus making it
impossible to umount /usr/ during shutdown.

Several Debian users use dash (popcon claim 18.57% have it installed
and 5.50% used it last week), so most problems with bashism in shell
scripts are already located and fixed.

Switching to dash gave Carlos Villegas a 4 second (7.5%) speedup on
his Etch test system.  Such speedup would be very welcome in the
generic Debian boot as well.

To switch, the dash package need to be installed, and the debconf
preseeding value to enable it need to be set:

  dash dash/sh boolean false

Those wishing to switch back to bash can do so by running
dpkg-reconfigure dash.

Please consider making such switch a release goal or release target
for Lenny.

Happy hacking,
-- 
Petter Reinholdtsen



Reply to: