Subject: [WARNING] rc script might wipe your guests
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Fri, 8 Aug 2008 03:31:55 +0200


Folks!
This is a really serious issue!

recent changes to various (sysv)init scripts might
wipe out your guests and their config on every
system reboot!

here are the details:

/etc/rc.d/rc.sysinit (path might be different)
contain a line similar to this one:

find -L /var/lock /var/run ! -type d -exec rm -f {} \;

with the purpose to remove old files from
/var/lock and /var/run (which sounds like a good
idea, but the devil is in the detail)

now util-vserver uses /var/run/vservers.rev to
store links to the configured/active guests like
this:

lrwxrwxrwx  1  19 2008-08-07 14:23 42001 -> /etc/vservers/test1/
lrwxrwxrwx  1  19 2008-08-07 16:19 42002 -> /etc/vservers/test2/
lrwxrwxrwx  1  19 2008-08-06 11:50 42003 -> /etc/vservers/test3/

and each guest config, contains a link to the
actual guest data, like this:

lrwxrwxrwx  1  21 2008-08-07 16:02 vdir -> /vservers/test1

the problem is in the -L, which means that find
will not only remove all files in /var/run, but
also follow all symbolic links and remove all files
there, which will include the guest config and
more important the actual guest data/files

as Daniel Hokka Zakrisson did put it (quite nicely
IMHO) on the IRC channel:

"I don't know what kind of crack-rock whoever wrote
     that smoked, but that's the problem."

HTH,
Herbert