Hi On Thu, Jul 20, 2006 at 08:14:34PM +0400, Alexander Gerasiov wrote: > Ola Lundqvist wrote: > > >>As I can see, adding "-mount" to find will help us (or may be some other > >>find rules?) > > > > > > Yes, but the reason for that is that if you have the -mount > > option it do not clean the files as it should... But this > > indicates that this... > > > > > >>the following code will work ok: > >> > >> > >>/usr/lib/util-vserver/vserver.functions: > >>[...] > >>## Usage: prepareInit <vserver-directory> > >>function prepareInit > >>{ > >> pushd "$1/vdir" >/dev/null > >> case "$INITSTYLE" in > >> sysv) > >> { find var/run -mount ! -type d -print0; \ > >> find var/lock -mount ! -type d -print0; } | xargs -0r > >>$_CHROOT_SH rm > >>[...] > >> > > > > > > Can you test to instead of adding -mount to find, add -f to rm. > > Or maybe instead use the following: > > > > for A in $(find var/run ! -type d -print0) \ > > $(find var/lock ! -type d -print0) ; do > > rm -f "$A" > > done > > > > It would be nice to know if that works better. > ~# /usr/lib/util-vserver/chroot-sh --help > Usage: chroot-sh [--] <cmd> <args>* > > This program chroots into the current directory and executes the specified > commands there. This means that all used paths are relative to the current > directory, and symlinks can point to files under the current path only. > > The supported commands are: > cat <file> ... gives out <file> to stdout > append <file> ... appends stdin to <file> which is created when needed > truncate <file> ... clear <file> and fill it with stdin; the <file> is > created when needed > rm <file>+ ... unlink the given files > > > So -f won't work. > > for .. in ..;do done > won't work if there will be files which contains space or line break.
True, I just wanted you to test it to see of that makes sense to go further with. > May be it would be better to consult upstream or wait when they will fix it? > I do not think upstream consider this as a bug. It is more of a feature enhancement actually, so that is why I ask you for help. Regards, // Ola -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ---- / [EMAIL PROTECTED] Annebergsslingan 37 \ | [EMAIL PROTECTED] 654 65 KARLSTAD | | http://www.opal.dhs.org Mobile: +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --------------------------------------------------------------- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]