How do I change the booting order of services?

Anders Häggström hagge.ubuntu at intercorner.net
Mon May 28 13:04:39 BST 2007


2007/5/28, Mildred <ml.mildred593 at online.fr>:
> Hi,
>
> Le Sun 27/05/2007 à 23:34 Anders Häggström à écrit:
> > Where do I change the bootorder of services that are starting in a
> > correct way in Ubuntu Feisty Fawn?
>
> I would say, you can't change the boot order directly ... What do you
> want to do exactly ?
>
I want to have a stripped down server at runlevel 2, with only
networkservice and a webif running, and a singleuser-mode at runlevel
1 which allmost runs without services in case some services get messed
up.
And I want to have a fiew more services running at runlevel 3, like
smartctl, acpid, cpufreqd and mount the encrypted dataarray (dm_crypt
with md_raid and lvm2).
And all the main-purpouse services at runlevel 4, like mysqld, smbd
etc, which should be the default runlevel.
My idea is to be able to isolate the services if somethings goes
wrong, thru the webif (or thru ssh). The easiest way to build such
script is to execute "telinit 1/2/3" and use the built-in
functionality of runlevels. And sometimes when upgrading the system I
don't want all servicese running and an easy way to manage that is to
just switch to a lower runlevel.

The bootorder is just because I want dm_crypt to mount before mdadm
starts to assemble the arrays and after that load lvm2. The default
way is to assambe md-arrays first and then load dm_crypt and last
lvm2.
This is not secure, because if the encryption calculate something
wrong I will loose the whole array. In my way, if an ecryption craches
I only loose one raid-slice, and mdadm will detach it and alarm. Yes
it puts alot more load on the cpu, but I think it's worth it.
> > Where do I fin detaild information about the booing procedure?
> > And how do I change the default runlevel?
>
> Well, did you looked at the upstart website ?
Yes, I have. But I can't find any deep information about the boot
procedure (for example which configfile controls the initial start and
where it continues, and how the shutdown/reboot initiate and
continues). I know that Upstart is ment to spawn services as the
become availible. I can understand that this setup is of good use in a
desktop client, but that doesn't fit my server very well.
>
> And why do you want to change the default runlevels ? There are no
> runlevels with upstart. Once again what do you want to do ?
There are a lot of "leftovers" from SysV in Feisty. When I check which
runlevel I'm in, it tells me "N 2", and if I change the order of the
links in /etc/rcS.d/ the bootorder will in fact change. But I guess
that is not the correct way to do it with Upstart, and that's why I'm
asking.
I've read that Upstart is using rulebased scripts. Where do I find the
scripts and why is /etc/rcX.d/ still working if Upstart is handling
the bootprocedure in Feisty?
>
> Mildred (upstart with Arch Linux)

If I had been involved earlier in the development of Upstart, I would
have sugested keeping the SysV-model for runlevel S,0,1,2,3,4,6 (for
server use and lowlevel-services) and use the Upstart-procedure at
runlevel 5 only (for desktop use, GUI and such).
As far as I can see the most benefits of Upstart is conentrated to
desktop use and is not well suited in a server enviroment. Maby I'm
just conservative or haven't found any good documentation for Upstart.

// Anders



More information about the upstart-devel mailing list