How do runlevels work?
I'm replacing an active directory windows server with a linux one. I have to introduce the linux server onto the network, but without AD services (like dhcpd, ldap etc).
So I was hoping to create a runlevel that'll allow me to bring the linux server up on the network without these services, then, when I've removed the windows server, I can change runlevels and start ldap etc.
I remember reading that runlevels are deprecated - is this correct? - If so, how can I achieve my goals?
Before I'd asked my question, I didn't know about upstart. For those interested, upstart is an event-driven (instead of a state-transition driven) replacement for the old "System V init" system.
To get to the point and skip the documentation, have a look at the /etc/init folder. You'll find several .conf files in there. Editing these files allow you to control at which runlevels different services come up and go down. These include samba4.conf, which was the main one I was concerned about (as this also controls ldap, kerberos, etc).
I initially went to /etc/init.d/rc2.d and wondered why there were no entries for samba there.
Just to confuse the issue, bind9 (along with other services) is still configured via the old system V init scripts in /etc/rcx.d, so, I rm'd /etc/rc2.d/S15bind9 and made a symlink K15bind9 to the same target in /etc/rc2.d/
Runlevels determine which services are started and what processes will run. A default ubuntu system boots up runlevel 2 where it will have all of it services up and running.
You could try creating your own runlevel for example on runlevel 3, but it will be quite a hassle, it might be easier to simply boot the system without the NIC cable plugged in and simply stop DHCP. Then introduce it and when the old server has been decomissioned simply start the DHCP.
Keep in mind the following are reserved no matter what:
runlevel 0 = halt sytem
runlevel 1 = Maintenance Mode (single usermode)
runlevel 6 = reboot
I hope this helps you on your way.