Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39919 - bootmisc doesn't clear out /var/run/*.pid files
Summary: bootmisc doesn't clear out /var/run/*.pid files
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 38436 (view as bug list)
Depends on:
Blocks: 42987
  Show dependency tree
 
Reported: 2004-01-30 16:37 UTC by Pablos
Modified: 2004-08-01 21:26 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 Pablos 2004-01-30 16:37:44 UTC
I haven't dug into this script to figure out what the problem is, but when a Gentoo machine comes up after a catastrophic halt (e.g. power outage) services will fail to start because of the /var/run/*.pid files that remain.  I believe that the bootmisc script is supposed to be wiping these out on boot, but doesn't.  Examples are sshd & apache2.  Also, the zap action on init.d scripts doesn't seem to wipe these files out, and it seems to me like it should.

Reproducible: Always
Steps to Reproduce:
1. rc-update add sshd default
2. /etc/init.d/sshd start
3. pull the power plug on your computer
4. reboot 
5. note that sshd isn't running.
Actual Results:  
sshd won't run until you rm /var/run/sshd.pid 

Expected Results:  
I believe the /etc/runlevels/boot/bootmisc script is supposed to find these 
latent *.pid files and wipe them out.
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2004-02-16 04:40:10 UTC
*** Bug 38436 has been marked as a duplicate of this bug. ***
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-19 10:52:55 UTC
Emerge info please.
Comment 3 Pablos 2004-02-19 14:13:44 UTC
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.20-gentoo-r7)
=================================================================
System uname: 2.4.20-gentoo-r7 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.4.3.13
distcc 2.11.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.ccccom.com ftp://gentoo.ccccom.com http://cudlug.cudenver.edu/gentoo/"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bonobo cdr crypt cups dvd encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile imlib java jpeg kde ldap libg++ libwww mad maildir mikmod motif mozilla mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png postgres python qt quicktime readline samba sdl slang spell ssl svga tcpd truetype video_cards_radeon x86 xml2 xmms xv zlib"

Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-26 09:06:40 UTC
Could you edit bootmisc, and change:

--
            for x in $(find /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed)
            do
                local daemon="${x##*/}"
                daemon="${daemon%*.pid}"
                # Do not remove pidfiles of already running daemons
                if [ -z "`ps --no-heading -C "${daemon}"`" ]
                then
                    if [ -f "${x}" -o -L "${x}" ]
                    then
                        rm -f "${x}"
                    fi
                fi
            done
--

to:

--
            for x in $(find /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed)
            do
                local daemon="${x##*/}"
                daemon="${daemon%*.pid}"
                echo "*** daemon=$daemon ***" &>> /tmp/log.txt
                # Do not remove pidfiles of already running daemons
                if [ -z "`ps --no-heading -C "${daemon}"`" ]
                then
                    "  Trying $x ..." &>> /tmp/log.txt
                    if [ -f "${x}" -o -L "${x}" ]
                    then
                        "  Deling $x ..." &>> /tmp/log.txt
                        rm -f "${x}"
                    fi
                fi
            done
--

Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-26 09:07:36 UTC
And then of course do your 'catastrophic halt' and post log.txt here?
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-08-01 21:26:38 UTC
No response from user, closing