home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 21807 < prev    next >
Encoding:
Text File  |  1992-12-27  |  2.3 KB  |  55 lines

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