Bourne Shell INTR kills children

Bourne Shell INTR kills children

Post by David McNic » Fri, 08 Oct 1993 00:20:49



I'm having problems with the Bourne Shell under SunOS 4.1.3. I'm running
X Windows, and sometimes start applications in the background. The trouble
is, if I start a background process and then type `^C' on the parent
window, it sends an INTR signal to ALL the child processes, including the
background one.

Is there a way to stop this ???

The other problem is that when I kill the shell, all of its child processes
are killed, but from what I've heard, this seems to be standard Bourne
Shell behavior (ie. a feature, not a bug !).

The first problem is very annoying though, and if anyone has any answers,
please e-mail me ;)

Ta-
        Dave.

    +----------------------------------------------------------------+
    |                                                                |
    | David McNicol, 4th year laser physics, Strathclyde University. |
    |                                                                |

    |                                                                |
    +----------------------------------------------------------------+

 
 
 

Bourne Shell INTR kills children

Post by damer.. » Fri, 08 Oct 1993 05:34:57


: I'm having problems with the Bourne Shell under SunOS 4.1.3. I'm running
: X Windows, and sometimes start applications in the background. The trouble
: is, if I start a background process and then type `^C' on the parent
: window, it sends an INTR signal to ALL the child processes, including the
: background one.

: Is there a way to stop this ???

: The other problem is that when I kill the shell, all of its child processes
: are killed, but from what I've heard, this seems to be standard Bourne
: Shell behavior (ie. a feature, not a bug !).

: The first problem is very annoying though, and if anyone has any answers,
: please e-mail me ;)

: Ta-
:       Dave.

:     +----------------------------------------------------------------+
:     |                                                                |
:     | David McNicol, 4th year laser physics, Strathclyde University. |
:     |                                                                |

:     |                                                                |
:     +----------------------------------------------------------------+

RTFM
man 1 nohup

--
Dan Mercer                                            Applications + Plus

======================================================================
Legends of Rock Trivia Quiz:
Who said: "If this is Troy,  I'm with the Greeks!"

Bonus Points: Where and When.

 
 
 

1. Bourne Shell script, that kills its child-processes?

Do you know, how I can create Bourne Shell script, that kills every
child-process, that it has started as background processes. Now it is
done like this:

trap '
   killall -15 xscreensaver-command 2> /dev/null
   echo "0" > $WATCHER_FILE
   exit 0
' 1 2 3 15 20

set +o noclobber
echo "0" > $WATCHER_FILE

xscreensaver-command -watch |
while read line
do
  foo=$(echo $line | awk '{print $1}' - )
  if test "$foo" = "BLANK"
  then
    my_debug "screen is blanked"
    echo "1" > $WATCHER_FILE
  elif test "$foo" = "LOCK"
  then
    my_debug "screen is locked"
    echo "1" > $WATCHER_FILE
  elif test "$foo" = "UNBLANK"
  then
    my_debug "screen is UNblanked"
    echo "0" > $WATCHER_FILE
  fi
done

That "killall -15 xscreensaver-command" is not very elegant. I want to
kill only that one xscreensaver-command -process and child-process,
that is created in that line saying "while read line".

--

http://www.cc.jyu.fi/~juhtolv/ * * "STRAIGHT BUT NOT NARROW !!"
---------------------------------------------------------------
"if i was twice the man i could be, i'd still be half of what
you need"                                       Nine Inch Nails

2. Automatically starting program when GNOME starts

3. killing a shell script is not killing child processes

4. Xircom CBEM56G

5. Syslog only getting ip numbers

6. ESIX kills shell with intr character.

7. Kernel Compile Issues

8. killing a shell that has a running child shell

9. Light Speed Bourne Shell! (was: Bourne shell tricks)

10. Killing a background process in Bourne shell

11. Killing a background process in Bourne shell...

12. Bourne shell - cd failure kills script