Subject: start-vservers patch
From: Jeff Jansen <jeff.jansen@kkoncepts.net>
Date: Tue, 01 Feb 2011 13:12:54 +0800

Here's patch for the "start-vservers" script to implement the ability to
specify the order in which vservers are started and stopped.  (Since I
asked about it some time ago I thought I should post my solution.) :-)

http://www.kkoncepts.net/sites/default/files/start-vservers.patch

(I'm not sure if you can attach files to this mailing list, so I'm just
posting a link.  The patch is against "util-vserver-0.30.216-pre2926"
but it also applies cleanly against "util-vserver-0.30.215".)

This allows you to create a new file called "startorder" in a vserver's
"apps/init" directory in which you can specify what order that vserver
should be started relative to the others - 1, 2, 3, ...

Vservers are started in the (numerical) order you specify and stopped in
reverse order.  Vservers with the 'mark' file set but without the
'startorder' file are started after all vservers which do have the
'startorder' file.  If you have specified a 'depends' file, that is
still honored.

I'd be glad if this got included in the next util-vserver package so I
don't have to patch it myself anymore, but, of course, patching isn't
hard, so feel free to ignore this completely. ;-)

And if anyone sees any bugs, improvements, etc., please do let me know.

TIA

Jeff Jansen