[sclug] ubuntu runlevels from grub

Tom Carbert-Allen tom at randominter.net
Fri Feb 1 20:15:42 UTC 2008


well it seems the message i sent earlier (see below) was from my other 
account so wasn't accepted to the list (???) but i have solved the 
problem now anyway.

I wrote some scripts I wanted to fire off from the grub menu by using 
the old way of passing a runlevel number at the end of the line, but it 
appears upstart (the replacement for init) only detects "single" or 
defaults to runlevel2 (2-5 look the same to me on server anyway, and 
even have a comment they are only there for compatability)

After banging my head against the wall trying to figure it out I 
realised the above about upstart ignoring runlevels. I considered fixing 
it up pushing it upstream but being friday night i'm not writing 
polished enough code for that.... So instead i just stuck my script in 
runlevel 2, cat /proc/cmdline, look for my triggers (which are now words 
rather than single digit runlevels) and case to fire off the stuf i 
want. Much better solution.

TCA


Previous message:


I feel like i've gone stupid,

In the past I have setup init based machine where I simply pass a 
runlevel to the kernel by adding the number on the end of the grub 
kernel line, so I can fire off an automated process from grub with a 
reboot at the end and return to my main interactive runlevel.

I have just tried this with Ubuntu running 2.6.20-15-server defualt 
kernel and it seems to totally ignore it no matter what I do. What am I 
doing wrong? Does upstart need sending the signal in a different way?

I have looked around on the web a bit but all the hits seem to be about 
people wanting to turn X on or off and the replies are always to change 
the default runlevel.

Thanks for your comments,

TCA - slowly converting to Ubuntu.....



More information about the Sclug mailing list