Pues eso vamos a ver que tenemos que cambiar para poder seleccionar el runlevel al iniciar el sistema con grub.
Comentamos todo el contenido del archivo /etc/event.d/rc-default y añadimos lo siguiente.
start on stopped rcS
script
runlevel --reboot || true
RL="$(sed -ne 's/.*init \([2-5S]\).*/\1/;p’ /proc/cmdline || true)”
if [ -n "$RL" ]; then
telinit $RL
elif [ -r /etc/inittab ]; then
RL=”$(sed -n -e ‘/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}’ /etc/inittab || true)”
if [ -n "$RL" ]; then
telinit $RL
else
telinit 2
fi
else
telinit 2
fi
end script
Una vez hecho esto solo tenemos que añadir ciertas lineas en /boot/grub/menu.lst
Tendremos algo como esto:
| title Ubuntu 9.04, kernel 2.6.28-11-generic uuid 43249e28-22e2-4a5c-b6c2-ed70f48bc348 kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=43249e28-22e2-4a5c-b6c2-ed70f48bc348 ro quiet splash initrd /boot/initrd.img-2.6.28-11-generic quiet |
Y lo modificamos tal que así (este caso arrancaráa en el runlevel 3):
| title Ubuntu 9.04, kernel 2.6.28-11-generic runlevel 3 uuid 43249e28-22e2-4a5c-b6c2-ed70f48bc348 kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=43249e28-22e2-4a5c-b6c2-ed70f48bc348 ro quiet splash init 3 initrd /boot/initrd.img-2.6.28-11-generic quiet |
Podemos añadir otro grupo de lineas para que arranque con el runlevel 4:
| title Ubuntu 9.04, kernel 2.6.28-11-generic runlevel 4 uuid 43249e28-22e2-4a5c-b6c2-ed70f48bc348 kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=43249e28-22e2-4a5c-b6c2-ed70f48bc348 ro quiet splash init 4 initrd /boot/initrd.img-2.6.28-11-generic quiet |
Ahora solo nos queda decidir que daemons queremos que arranque en cada nivel, yo por ejemplo tengo configurado en el runlevel 3 que arranque xbmc.
Un saludo. Denos.