bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trap documentation does not match trap behavior


From: John Gatewood Ham
Subject: trap documentation does not match trap behavior
Date: Thu, 11 May 2006 01:10:56 +0700 (ICT)

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g -O2
uname output: Linux www.buraphalinux.org 2.6.16.15 #1 Wed May 10 16:48:09 ICT 
2006 i686 pentium4 i386 GNU/Linux
Machine Type: i586-pc-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

Description:
        The info file says "Trapped signals are reset to their original
        values in a child process when it is created." but this is not
        true for me with crond and smartd for the SIGTERM signal.

Repeat-By:
        crond is Dillon's cron with many patches; I get the same
        problem with smartmontools' smartd daemon.  Source for
        our crond package if you need to see the source code
        is in:

http://www.buraphalinux.org/download/bls1.0/sourcecd/source/1/base/dcron

        #!/sbin/bash
        # this launches a crond that will NOT get the SIGTERM
        # from killall crond and does not shutdown
        trap '' TERM
        /usr/sbin/crond -l8
        exit 0

        #!/sbin/bash
        # this launches a crond that will get the SIGTERM
        # from killall crond and shutdown
        doit() {
          trap - TERM
          /usr/sbin/crond -l8
          trap '' TERM
        }
        trap '' TERM
        doit
        exit 0

Fix:
        Remove that sentence from the documentation?  Maybe
        add a description in the same place in the info file
        of what 'set -o ???' needed to control whether signals
        get inherited or not?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]