Tuesday, January 08, 2008

Changing the default runlevel in Ubuntu Server 7.10

It appears that in the most recent versions of Ubuntu upstart has replaced inittab as the mechanism used to change the default runlevel and to start and stop services at boot up and shutdown.

When I installed Ubuntu Server 7.10 the default runlevel was set to 'S' (single user). The single user runlevel isn't very useful with a server as it doesn't start any services on boot up. I needed sshd and httpd among other services to start on boot up. After a time consuming consultation with google I finally figured out how to change the default runlevel. I don't know that this is the best way to do it, but it worked for me.

Basically all I had to do was edit /etc/event.d/rc-default and change the occurances of 'telinit S' to 'telinit 5'