home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3967 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.5 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!usc!rpi!batcomputer!cornell!rochester!galileo.cc.rochester.edu!ee.rochester.edu!moscom!jmp
  2. From: jmp@moscom.UUCP (Joe Palumbos)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Controlling Terminal question
  5. Message-ID: <3836@moscom.UUCP>
  6. Date: 28 Jul 92 19:04:27 GMT
  7. Organization: Moscom Corp., Pittsford, NY
  8. Lines: 32
  9. X-Newsreader: Tin 1.1 PL3
  10.  
  11. I have a program that replaces getty:  it conditions a port, then
  12. waits for input for a login.  
  13.  
  14. It works ok if I start my own executable program, but if I try to
  15. fork & exec 'su -<usr>' to allow a standard login from that port, I 
  16. get the following message on the port:
  17.  
  18.     Reset tty pgrp from <parent-pid> to <child-pid>
  19.  
  20. If I ignore SIGHUP, I get this 'reset' msg about 24 times, then
  21. the child (su) dies.
  22.  
  23. if I trap SIGHUP & write a debug-msg to a file, I get the message
  24. 2 times, and the child (su) runs on the port, but the parent dies
  25. ('Hangup'), after the debug-msg is written.  
  26.  
  27.     - I'm running on SunOS 4.1.2
  28.     - The port is not configured to run getty.  
  29.     - To dissociate the child from the parent, before 
  30.       the exec() call, I do the following:
  31.         - close fd 0,1 & 2.
  32.         - call setsid() to start a new session w this port as 
  33.             the controlling term.
  34.         - open the port 2x for std in/out
  35.         - dup stdout for stderr
  36.     - I condition the port with standard stty settings 
  37.  
  38.  
  39. Is there something else I need to do to remove the terminal from
  40. the process-group of the parent?  Any help will be appreciated.
  41. -- 
  42. Joe Palumbos    jmp@moscom.com        {rit,tropix,ur-valhalla}!moscom!jmp
  43.