
Code: Select all
( find /var/lock -type f -exec rm -f -- {} \; 1>&2 )
That's not a solution, that's a hack which conceals that there is too much exported to the environment. And BTW it's almost exactly what bootmisc 1.24 did.no usernames left wrote:A better solution to this problem is the following line:Code: Select all
( find /var/lock -type f -exec rm -f -- {} \; 1>&2 )
'find $dir | xargs $cmd' is generally faster than 'find $dir -exec $cmd {} \;' if 'find' finds lot of files, because $cmd is executed for a set of files (vs. $cmd is executed for every single file).CRC wrote:I'm curious as to why the change was made to use xargs anyway?
Correct. As long as execution time does not matter (what generally is the case while booting...) one should use finds -exec action. And, BTW, a common /var/lock does not contain thousands of files, so 'find | xargs' won't be much faster...CRC wrote:It seems like you are just adding yet another process into the mix needlessly when the -exec argument to find does what is required. Isn't this similar to using "cat file | command" instead of "command <file" ??
Code: Select all
( find /var/lock -type f -print0 | xargs -0 rm -f -- 1>&2 )Code: Select all
( cd /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 )Worked great, thanks!geg wrote:Just found that a backup of /etc/init.d was made in /etc/init_d.old. Replace in your /etc/init.d/bootmisc
byCode: Select all
( find /var/lock -type f -print0 | xargs -0 rm -f -- 1>&2 )
It worked for me.Code: Select all
( cd /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 )![]()
Ciao
GNU xargs first determines the max arg list length (128kB on Linux) and then subtracts 2kB (POSIX requires this). If the result is >20kB it is set to 20Kb. From this the env size is subtracted. If this result is <=0 xargs gives up complaining about "environment is too large for exec".quattro wrote:From what I understand, xargs uses the exec() system call to run the command. Linux limits the amount of space for exec() to 128K total for the environment and arguments.
What I don't understand is, my experiments show that during init, my environment was approximately 50K. xargs limits the command line to 20K. Add those two up and you get approx 70K. What happened to the other 58K? Is xargs broken? Is the system limited to only 128K for all processes? What don't I understand?

Jukka;jukka wrote:Not to call xargs works of course, but the real problem is IMHO that the environment is about 28k during boot, at least on my box.
To get the size of the environment during boot i executed the following program from /etc/init.d/bootmisc:
...snip...
My env size was 28261...
If I understand correctly your /etc/init.d/bootmisc contained the lineatescha wrote:I accidently did a find instead of a cd where the fix of the error message was. Now, nothing is at it used to be. Something´s seems to be deleted, anyone know a fix for this, or is it reinstall?
Code: Select all
( find /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 )
This might work. But what happens, if /var/lock can not be found for any reason? Don't ask me what the reason could be!!! Then rm will kill all files in the current directory, right?geg wrote:It worked for me.Code: Select all
( cd /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 )![]()
Ciao
Code: Select all
( find /var/lock -type f -exec rm -f -- {} \; 1>&2 )
No.ikeaman wrote: [...]This might work. But what happens, if /var/lock can not be found for any reason? Don't ask me what the reason could be!!! Then rm will kill all files in the current directory, right?Code: Select all
( cd /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 )
If /var/lock doesn't exist, cd returns 1.man bash wrote:The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form
command1 && command2
command2 is executed if, and only if, command1 returns an exit status of zero.

It has already been fixed in baselayout-1.8.6.9.ebuild. See the end of http://bugs.gentoo.org/show_bug.cgi?id=21438.andersbk wrote:I just did an emerg sync and an emerge -puD world to see what was new (I have installed 1.4rc4.)
Nothing in etc is updated...so the problem still persists.
Has this been logged to the bug database so the developer responsible can fix it?
-anders.
Code: Select all
emerge /usr/portage/sys-apps/baselayout/baselayout-1.8.6.9.ebuildI'm a bit dubious about emerging the whole package, as it affects all init scripts. So, I will just be hacking my "bootmisc" script until the next baselayout ebuild is released.quixoticsycophant wrote:The real question is why is it still masked.Code: Select all
emerge /usr/portage/sys-apps/baselayout/baselayout-1.8.6.9.ebuild
-qs