Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 359831 - sys-apps/openrc-0.7.0: bootmisc fails cleaning /tmp with many files
Summary: sys-apps/openrc-0.7.0: bootmisc fails cleaning /tmp with many files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 18:26 UTC by Martin Walch
Modified: 2011-03-25 16:44 UTC (History)
1 user (show)

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


Attachments
bootmisc clean up (0001-bootmisc-clean-up-tmpdir-cleaning.patch,3.27 KB, patch)
2011-03-23 18:49 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Walch 2011-03-21 18:26:04 UTC
If there are too many files in /tmp, bootmisc fails on startup with:

/etc/init.d/bootmisc: line 36: /bin/rm: Argument list too long

This turns the command in line 21 to take almost forever:

find $startopts ! -name . \
        ! -path "./lost+found" \
        ! -path "./lost+found/*" \
        ! -path "./quota.user" \
        ! -path "./quota.user/*" \
        ! -path "./aquota.user" \
        ! -path "./aquota.user/*" \
        ! -path "./quota.group" \
        ! -path "./quota.group/*" \
        ! -path "./aquota.group" \
        ! -path "./aquota.group/*" \
        ! -path "./journal" \
        ! -path "./journal/*" \
        -exec rm -rf {} \;

bootmisc is blocking the bootup process for several minutes and leaves the find process from line 21 consuming one processor.

emerge --info baselayout:
Portage 2.1.9.42 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.5, glibc-2.11.3-r0, 2.6.38-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.38-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8400_@_2.66GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 21 Mar 2011 08:15:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r2, 3.1.3-r1
dev-util/ccache:     2.4-r9
dev-util/cmake:      2.8.4
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE bea.ri.jsr173 dom4j GPL-2-with-MySQL-FLOSS-exception icu JasPer2.0 jaxen JDOM NCSA-HDF Radiance saxpath wxWinFDL-3 GPL freedist MOTIF Allegro unRAR MSttfEULA UCAR-Unidata GDLS ISOC-rfc intel-ucode truecrypt-3.0"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fgcse-after-reload -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -fgcse-after-reload -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache collision-protect distlocks fixlafiles fixpackages metadata-transfer mirror multilib-strict news nostrip parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=native -O2 -fgcse-after-reload -pipe"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://gentoo.mneisen.org/ http://mirror.ovh.net/gentoo-distfiles/ http://mirror.netcologne.de/gentoo/ http://mirrors.linuxant.fr/distfiles.gentoo.org/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/unknown-horizons /var/lib/layman/java-overlay /usr/local/portage /usr/local/portage/worldforge"
SYNC="rsync://rsync3.de.gentoo.org/gentoo-portage"
USE="64bit X Xaw3d a52 aac aalib accessibility acl acpi agg akode allegro alsa amarok amd64 amr apache2 autoipd bash-completion bazaar berkdb bittorrent blender blender-game branding bzip2 cairo captury ccache cdaudio cdr cdrom cegui cjk cli clucene consolekit cracklib crypt cups curl cviewer cvs cxx daap dbus deblob declarative default-font designer-plugin desktopglobe devil dga dirac djvu doc dri dts dvd dvdnav dvdr dxr3 emacs embedded emboss encode exif fam fbcon ffmpeg fftw firefox fits flac fltk fortran gcj gdbm gdu ggi git glitz gmm gmp gopher gpg gpm gpu grub gstreamer guile gzip htmlhandbook i18n iceweasel icons iconv icq icu idn imagemagick insecure-savers intel ipv6 jabber jack java java6 javascript jingle jpeg kde kde4 kdebuild kdecards kdehiddenvisibility kdepim kdm kontact ktts latex lcms ldap libcaca libnotify libssh2 libwww lm_sensors logitech-mouse lua lzma lzo matroska mdnsresponder-compat mercurial mikmod mmx mng modules mpeg mpeg2 mpfr mpi mudflap mule multilib musepack mysql ncurses nepomuk networkmanager nio2 nls noamazon nova nowin nptl nptlonly nsplugin offensive ogg ogg123 openal openexr opengl openmp openssl opensslcrypt openstreetmap openxml oscar otr oxygen pae pam pango pcre pdf perl phonon plasma player png policykit posix povray ppds pppd private-headers python qt3support qt4 readline redland reiser4 reiserfs rss schroedinger sdl sdl-image semantic-desktop sensord session shm shmvideo sndfile solver songs sound speex spell sse sse2 sse3 ssl ssse3 startup-notification subversion svg sysfs systemtap tcpd tetex theora threads tidy tiff tk tools truetype type1 udev unicode usb v4l2 vaapi vhook videos visualization vorbis vpx wav wavpack wikipedia wmf wxwindows x264 xcb xcomposite xemacs xerces-c xhtml xine xml xorg xosd xprint xrandr xscreensaver xulrunner xv xvid xvmc zeroconf zfs zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="i965 intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-apps/baselayout-2.0.1-r1 was built with the following:
USE="(multilib) -build"
Comment 1 SpanKY gentoo-dev 2011-03-21 22:11:08 UTC
should just change it to -exec rm -rf {} +
Comment 2 SpanKY gentoo-dev 2011-03-23 17:47:38 UTC
can you recreate your setup easily ?  what i'm thinking we'd want to do is change the rm on line 36 to this logic:

if ! rm -rf -- [^ajlq\.]* 2>/dev/null ; then
    find . -maxdepth 1 -name '[^ajlq\.]*' -exec rm -rf -- {} +
fi

does that run slowly for you too ?
Comment 3 SpanKY gentoo-dev 2011-03-23 18:49:52 UTC
Created attachment 267013 [details, diff]
bootmisc clean up

actually, just try out this patch
Comment 4 Martin Walch 2011-03-24 16:19:17 UTC
Patch works fine with 444552 files (about four minutes). However, taking more than 60 seconds, this leads to a timeout for consolefont, net.lo and keymaps. Is this a problem?
Comment 5 SpanKY gentoo-dev 2011-03-24 17:17:39 UTC
how long would a straight `rm -rf /tmp/*` take in that case ?  if that takes like 3 minutes, then there isnt much optimization we can do.

as for script timeouts, i dont think that should happen ... are you using parallel start or something ?
Comment 6 Martin Walch 2011-03-24 18:03:42 UTC
(In reply to comment #5)
> how long would a straight `rm -rf /tmp/*` take in that case ?  if that takes
> like 3 minutes, then there isnt much optimization we can do.

The reason for this bug report is that rm does not work in this case. :)

$ rm -rf /tmp/*
bash: /bin/rm: Argument list too long

However, with several calls of rm, the runtime is not much faster than with find. Actually, I did not expect that find would be that fast. So, no need for further optimization.

> as for script timeouts, i dont think that should happen ... are you using
> parallel start or something ?

yes, I am:

$ grep rc_parallel /etc/rc.conf 
rc_parallel="YES"
Comment 7 SpanKY gentoo-dev 2011-03-24 18:55:39 UTC
yes, sorry i meant `rm -rf /tmp/`.  the point was to see if the slowdown was from find|rm or if it's going to be slow because there's so many files.  good that the patch as is is as good as it's going to get for the most part.

i think we should close out this issue with the proposed fix and clone it to address the timeouts in a new bug report.
Comment 8 Martin Walch 2011-03-25 10:40:09 UTC
Cloned as bug #360405.
Comment 9 William Hubbs gentoo-dev 2011-03-25 16:44:01 UTC
The patch from comment #3 is applied, commit 7c1a2de.

This bug is being closed because we have bug #360405 for the timeout
issues.