Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 79325

Summary: sleep dies with SIGUSR1 sometimes
Product: Gentoo Linux Reporter: Erik Thiele <erik>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED NEEDINFO    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Erik Thiele 2005-01-24 05:52:41 UTC
i am running
sys-apps/coreutils-5.2.1
this contains /bin/sleep
i am running the following shellscript:

#!/bin/bash

set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

PIDFILE=/var/local/run/proedruckd.pid
if [ -e "$PIDFILE" ]; then
        logger 'proedruckd: not starting because pidfile already exists'
        exit 1
fi

function cleanup() {
        logger 'proedruckd: exiting'
        rm -f "$PIDFILE"
}
trap cleanup EXIT

echo $$ > "$PIDFILE"
logger 'proedruckd: started'

cd /Druckjobs/working
while true; do
    for job in *; do
        if ! [ "$job" = '*' ]; then
            logger "proedruckd: job=x${job}x"
            NUMC=$(echo "$job"|sed 's/^.*C//')
            logger "proedruckd: job $job processing"
            set +e
            X="$(proehpgldruck "$job" "$NUMC" 1>&2 >/dev/null)"
            if ! [ $? = 0 ]; then
                X="proehpgldruck fehlgeschlagen. $X"
            fi
            set -e
            if ! [ "$X" = "" ]; then
                mail -s proedruckd erik@mine.lan <<EOF
proedruckd hat Probleme mit dem job
$job

Die Meldung des proehpgldruck Programmes ist
$X
EOF
            fi
            logger "proedruckd: erasing job"
            rm -f "$job"
        fi
    done
    sleep 2
done

you see in the second last line the command 'sleep 2'. in my former debian
installation this shell script daemon ran forever. after porting it to gentoo
i am experiencing the problem that occasionally it just dies. after starting
it in a xterm i could see the message making it die:

roy root # /usr/local/sbin/proedruckd 
/usr/local/sbin/proedruckd: line 48:  2327 User defined signal 1   sleep 2
roy root # 

line 48 is the line after the sleep call. the problem comes sometimes every
two days, sometimes 2 times a day. i don't have a single clue why this sometimes
happens. i am relativly sure that there is no other program running 
(at least not written by me!!!) that does something like a killall of all sleep processes with a SIGUSR1.

i am confused and i don't know how to debug any further.

for now i continue running that daemon from console so that i can restart it
once it crashes in the sleep call. but of course that sucks :)


cya!
erik

Reproducible: Always
Steps to Reproduce:




Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1,
2.4.26-gentoo-r9 i686)
=================================================================
System uname: 2.4.26-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks nostrip sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.osuosl.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apm arts avi berkdb bitmap-fonts crypt cups doc emacs encode esd f77 fam
foomaticdb fortran freetds gdbm gif gimpprint gnome gpm gtk gtk2 imagemagick
imlib java jpeg kde ldap libg++ libwww mad mikmod mmx mng motif mpeg mssql
ncurses nls odbc oggvorbis opengl oss pam pdflib perl png postgres ppds python
qt quicktime readline samba sdl slang spell sse ssl tcpd tetex tiff truetype
unicode usb wmf x86 xml2 xmms xv zlib linguas_de"
Comment 1 SpanKY gentoo-dev 2005-01-25 06:46:04 UTC
please try debugging this on the forums and/or gentoo-user mailing list