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. May be it would be better to consult upstream or wait when they will fix it? -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]