home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!mcsun!fuug!news.funet.fi!hydra!klaava!torvalds
- From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
- Subject: Re: What logs off?
- Message-ID: <1992Dec27.113831.4773@klaava.Helsinki.FI>
- Organization: University of Helsinki
- References: <Bzu94t.Gtx@nmrdc1.nmrdc.nnmc.navy.mil> <BzvxEC.7sz@citrus.SAC.CA.US>
- Date: Sun, 27 Dec 1992 11:38:31 GMT
- Lines: 44
-
- In article <BzvxEC.7sz@citrus.SAC.CA.US> qumqats@citrus.SAC.CA.US ( Joel M. Baldwin ) writes:
- >
- >I have to echo this question. I'm running SLS 0.98pl1 with the
- >0.98.pl4 kernel and I've noticed that if someone just hangs up
- >without logoff then they're >NOT< logged off. It looks like the
- >controling process is terminated, but if they're in a child process
- >then the parent is just left hanging.
- >
- >Is this a bug in the kernel or in init or what?
- >
- >I consider it a pretty serious problem for a public access system to not
- >have a user logged off when they hang up the phone for whatever reason!
-
- It's a bug in the kernel. In pre-0.99 kernels, a serial hangup resulted
- in SIGHUP being sent to the foreground processes, which is not correct:
- in 0.99 it's sent to the controlling process, which should help
- somewhat. In 0.99.1 the full POSIX requirements should be met, and the
- problem should be totally gone. Try upgrading - if you still have
- problems with 0.99.1 please contact me.
-
- With 0.99.1, the following is done when a hangup occurs:
-
- (a) send a SIGHUP to the controlling process of the tty (this is
- normally the first-level shell)
-
- (b) all subsequent read()'s on all files open to that tty will return
- EOF (0), and all subsequent write()'s will return -1 with errno
- being set to EIO.
-
- Additionally, when the controlling process dies, all the foreground
- processes will be sent a SIGHUP (this is not directly connected with the
- tty drivers, but it usually accompanies the tty hangup).
-
- You should also make sure that
- - the tty should have the CLOCAL flag cleared (CLOCAL is used to
- indicate that you are running a local serial line without hangup
- detection).
- - your modem is set up correctly to drop DCD when carrier is lost.
-
- Additionally, for extra safety you can use a 'login' binary that does a
- vhangup() when a new person logs in: that will kill any pending
- processes on that tty.
-
- Linus
-