Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22637 - init script bootmisc generates error xargs: environment is too large for exec
Summary: init script bootmisc generates error xargs: environment is too large for exec
Status: RESOLVED DUPLICATE of bug 21438
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-11 14:15 UTC by Mark Francis
Modified: 2005-07-17 13:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Francis 2003-06-11 14:15:07 UTC
On booting system, init script bootmisc generates error xargs: environment is
too large for exec. Fixed by simple change to remove xargs:
diff /etc/init.d/bootmisc /etc/init.d/bootmisc.fixed
44c44
<               ( find /var/lock -type f -print0 | xargs -0 rm -f -- 1>&2 )
---
>               ( find /var/lock -type f -exec rm -f "{}" \; 1>&2 )


Reproducible: Always
Steps to Reproduce:
1.Boot system
2.Read error message
3.
Comment 1 Pieter Van den Abeele (RETIRED) gentoo-dev 2003-06-14 04:37:36 UTC
can be reproduced on ppc. I'll try this patch asap.
Comment 2 Nathan W. Labadie 2003-06-19 11:43:50 UTC
Same problem here. The patch fixes it. 
Comment 3 Andreas Kotowicz 2003-06-22 10:03:34 UTC
same problem here. didn't happen to me with baselayout-1.8.5.9.ebuild, but now with baselayout-1.8.6.8 i get this error message everytime I boot
Comment 4 Christian Strauf 2003-06-22 23:13:25 UTC
The patch works for me as well. I would suggest though to replace

find /var/lock -type f -exec rm -f "{}" \; 1>&2

with

find /var/lock -type f -exec rm -f -- "{}" \; 1>&2

so that rm doesn't choke on "-*" files. This would also stick closer to the semantics of the original line.
Comment 5 Ian Abbott 2003-06-23 03:12:15 UTC
There is no need to add the double quotes around {}.  Outer parentheses on the 
command line also seem superfluous. 
 
I tested this line on file names containing spaces and newlines and it worked fine: 
 
  find /var/lock -type f -exec rm -f -- {} \; 1>&2 
 
Also, I'm not sure why it is necessary to redirect stdout to stderr, as the above 
command shouldn't produce any output on stdout anyway! 
Comment 6 Jukka Salmi 2003-06-23 03:47:24 UTC
Of course not calling xargs at all fixes the problem, but I wonder why my environment is about 28k during boot, because that's the reason why xargs fails (on my box _SC_ARG_MAX is 131072, so xargs sets arg_max to 20480. env_size is 28261 and gets subtracted from arg_max. No space left...).

I added '/usr/bin/printenv >/tmp/env.boot' to /etc/init.d/bootmisc (just before calling xargs). Lots of depinfo_*() and other functions. Is it really necessary for those functions to be exported to the environment?
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2003-06-23 13:14:06 UTC
Dup.  I however like Christian/Ian 's cleanups.

*** This bug has been marked as a duplicate of 21438 ***