On Mon, 30 Oct 2000, Ryan Thompson wrote:
> > (b) use tcgetpgrp to get the process group id of the foreground process
> > group on that tty, then with that info use libkvm to find the session
> > leader's pid and send it a SIGHUP
>
> Why not just kill their controlling shell?
I believe that what I'm doing...the "controlling shell" would be the
session leader. The question is how to get its PID.
> Recall that "background" and "foreground" are shell concepts, not
> properties of any given process.
No they are properties of process groups. Each session can have one
foreground process group and multiple background session groups. The
foreground process group is the one that receives signals and input from
the session's controlling terminal.
> a) Kill the controlling shell. This will leave some processes behind that
The question is how to get its PID?
> b) kill -<signal> `ps -axo user,pid | grep user | awk '{print $2}'`
I only want to grab those on the one tty but thats an easy enough
modification.
> c) /sbin/halt is pretty much guaranteed to do the trick ;-)
but sadly rather intrusive on other ttys :-)
Thanks for your help,
Andrew
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message