Here's a job control conundrum for you.

Steven W. Orr steveo at syslang.net
Wed Apr 11 12:24:23 EDT 2007


On Wednesday, Apr 11th 2007 at 10:22 -0400, quoth Ben Scott:

=>On 4/11/07, Steven W. Orr <steveo at syslang.net> wrote:
=>> My apologies. I confused more people than I intended.
=>
=> How much did you intend for us to be confused?  Many of us are
=>pretty confused already, so you might be able to just skip the whole
=>thing... ;-)
=>
=>> If I say
=>> killall -9 alpine
=>> then it dies. No problem. If I say
=>> kill -1 %1
=>> it dies also. The question I have is why
=>> killall -1 alpine
=>> does NOT work.
=>
=>Hmmm.  That *is* odd.  Does
=>
=>	killall --signal HUP --verbose alpine
=>
=>vs
=>
=>	killall --signal KILL --verbose alpine
=>
=>shed any light on the question?

Maybe:

525 > alpine

Alpine suspended. Give the "fg" command to come back.

[1]+  Stopped                 alpine
526 > killall --signal HUP --verbose alpine
Killed alpine(31954) with signal 1
527 > fg
alpine
528 > fg
-bash: fg: current: no such job

The --verbose shows that the kill(2) call did in fact not fail and that 
the process was delivered.

The fg then only prints out the name of the process but nothing happens. 
At the time between the kill and the FG, the ps -aux command shows that 
alpine is in the 

T    Stopped, either by a job control signal or because it is being 
traced.

Therefore, I surmise that the handler that is supposed to be in effect got 
confused by the combo 1,2 knockout punch of SIGSTP,HUP followed by an fg 
(which I've never understood).

I still don't know why it's different on the two different ssh sessions, 
but I feel good enough to submit this to the alpine crew.

=>
=>> Obviously, since the killall does work with SIGKILL then
=>> killall is succeeding at delivering the signal.  The HUP
=>> therefore must also be successfully getting delivered
=>> by killall, but the process (alpine) is not handling the
=>> signal in the same way.
=>
=> I'm always very wary of words like "obviously" and "must" when
=>dealing with anything that's not working, especially when the word
=>"odd" is also involved....
=>
=>> AFAIK, there's not supposed to be any difference in semantics dependant on
=>> whether the sender of the signal is in the same process group.
=>
=> Well, I don't really grok how process groups work, but try this:
=>
=>	killall --signal HUP --process-group --verbose alpine
=>
=>-- Ben
=>_______________________________________________
=>gnhlug-discuss mailing list
=>gnhlug-discuss at mail.gnhlug.org
=>http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
=>

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net


More information about the gnhlug-discuss mailing list