Wednesday, November 25, 2009

No more bootmisc.sh in Karmic Koala

Until 9.04, /etc/init.d/bootmisc.sh was used to provide automatic initialization to several services. It was invoked from /etc/rcS.d/S55bootmisc.sh, before X starting.

In 9.10, it does not work anymore, and I still do not know why. So, /etc/rc.local may be a replacemente for it. For instance, I have some VirtualBox shared folders I want to be available as soon as Karmic server is ready to work. So my /etc/rc.local now is like:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Shared Folders Mounts
if [ -z "$(grep '/media/SwitchFiles' /proc/mounts)" ]; then
/bin/mount -t vboxsf SwitchFiles /media/SwitchFiles
fi

# Shared Folders Mounts
if [ -z "$(grep '/var/cache/apt/archives' /proc/mounts)" ]; then
/bin/mount -t vboxsf AptArchives /var/cache/apt/archives
fi

exit 0

Some interestings notes:
- I do not trust /etc/mtab, but I'd rather believe in /proc information;
- Shared folders will just work if they are not mounted yet.
- The module vboxsf was provided by Virtualbox compilation process.

This procedure complements this article. Do not forget to comment and to tell if this was useful or not.

No comments: