/etc/init.d/virtualbox-ose wastes 10 seconds with find /lib/modules
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
virtualbox-ose (Debian) |
Fix Released
|
Unknown
|
|||
virtualbox-ose (Ubuntu) |
Fix Released
|
Wishlist
|
Daniel Hahler |
Bug Description
Binary package hint: virtualbox-ose
bootchart shows me that /etc/rc2.
if ! find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null
|grep -q vboxdrv; then
fi
if ! rm -f $DEVICE; then
fi
if ! modprobe vboxdrv > /dev/null 2>&1; then
out why"
fi
The sole purpose of that costly operation is to print a slightly more informative error message in case modprobe should fail.
I would suggest using 'modprobe -n -q vboxdrv' instead of find. Experiments show it takes only 1 second:
$ echo 3 |sudo tee /proc/sys/
3
$ time modprobe -n -q vboxdrv
real 0m0.995s
user 0m0.004s
sys 0m0.000s
$ time find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv
real 0m12.979s
user 0m0.036s
sys 0m0.076s
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: virtualbox-ose 2.1.4-dfsg-1ubuntu3
ProcEnviron:
LC_CTYPE=
PATH=(custom, user)
LANG=lt_LT.UTF-8
SHELL=/bin/bash
SourcePackage: virtualbox-ose
Uname: Linux 2.6.28-11-generic i686
Related branches
Changed in virtualbox-ose (Ubuntu): | |
assignee: | nobody → Daniel Hahler (blueyed) |
status: | Triaged → In Progress |
Changed in virtualbox-ose (Debian): | |
status: | Unknown → New |
Changed in virtualbox-ose (Debian): | |
status: | New → Fix Released |
Thank you for your investigation and proposed solution. This sounds like a great improvement in boot time.
I'm looking into getting it fixed in Karmic and forwarded to Debian.
My results (please note that you should use "sudo" for the modprobe call):
$ echo 3 |sudo tee /proc/sys/ vm/drop_ caches
3
daniel@base { ~ }
$ time sudo modprobe -n -q vboxdrv
real 0m2.076s vm/drop_ caches
user 0m0.008s
sys 0m0.004s
daniel@base { ~ }
$ echo 3 |sudo tee /proc/sys/
3
daniel@base { ~ }
$ time find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv
real 0m9.875s
user 0m0.028s
sys 0m0.072s