Idle Users

Jay R. Ashworth jra at baylink.com
Fri Jun 18 08:36:33 PDT 2004


On Thu, Jun 17, 2004 at 05:11:42PM -0700, Bob Rasmussen wrote:
> > > I have brainstormed on how I might improve on this situation. Both telnet
> > > and ssh allow the sending of several arbitrary signals to the server.
> > > Maybe I could offer an option where, on WM_QUIT, Anzio would send a hangup
> > > signal to the server. If the server trapped out the hangup, everything
> > > would stay running. If the hangup was handled normally, the server would
> > > close its end of the connection, and Anzio would exit gracefully.
> > >
> > > Reactions?
> >
> > At the risk of sounding ignorant, I'll bite.  Why would telnetd or sshd
> > themselves ever trap a HUP and not pass it along to the child process
> > group?
> 
> You misunderstand. It's not that telnetd or sshd would trap the HUP. They
> pass it along or even generate it in the case where the connection goes
> down. The problem is when some shell script in the process tree has
> trapped the HUP, or when the runtime ignores it (not the case with fP).

Let us take note here that the SIGHUP isn't the issue.

The SIGHUP is *generated* by the telnetd or sshd and sent to all
processess in the login process group *when it sees a close on the TCP
stream*.

Does closing one end of a TCP stream automatically and authoritatively
notify the other end?  I don't have a reference handy, but I'm pretty
sure it does.  So as long as you close your socket formally when you
shutdown, if the other end screws it up, it's their fault.  Hard
crashed at the client end, of course, are another matter; keepalives
are the only thing that will save you there.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274

                2004 Stanley Cup Champion Tampa Bay Lightning


More information about the Filepro-list mailing list