[BusyBox] sysinit script getting a SIGHUP?

Lars Kellogg-Stedman lars at larsshack.org
Fri May 11 14:08:10 UTC 2001


I wanted to open this question to a wider audience...

I've run into an odd problem with the busybox "init" applet.  A portion of
my inittab looks like this:

  ::sysinit:/etc/rc.sysinit
  ::wait:/etc/rc
  ::respawn:/sbin/getty -L ttyS0 9600 vt100

Everything started from rc.sysinit receives a HUP signal just after
rc.sysinit finishes running.  The sysinit script is starting up devfsd and
pump, both of which automatically background themselves -- though
apparently they aren't dissociating themselves from the console.

It's not clear to me what's causing the HUP in the first place.

I've come up with two workarounds:

(1) Attach the scripts to /dev/null:

      null::sysinit:/etc/rc.sysinit

    This solves the HUP problem, but of course it means that one doesn't
    see any output from the script.

(2) The solution I'm using right now is modifying the run() function in
    init.c to block the HUP signal:

      /* Reset signal handlers set for parent process */
      signal(SIGUSR1, SIG_DFL);
      signal(SIGUSR2, SIG_DFL);
      signal(SIGINT, SIG_DFL);
      signal(SIGTERM, SIG_DFL);

      /* ignore HUP signals */
      signal(SIGHUP, SIG_IGN);

    This works great.  Is there any reason why one would *not* want to
    isolate programs started from init from the HUP signal?

-- Lars

-- 
Lars Kellogg-Stedman <lars at larsshack.org>






More information about the busybox mailing list