home *** CD-ROM | disk | FTP | other *** search
- 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
- From: jmp@moscom.UUCP (Joe Palumbos)
- Newsgroups: comp.unix.programmer
- Subject: Controlling Terminal question
- Message-ID: <3836@moscom.UUCP>
- Date: 28 Jul 92 19:04:27 GMT
- Organization: Moscom Corp., Pittsford, NY
- Lines: 32
- X-Newsreader: Tin 1.1 PL3
-
- I have a program that replaces getty: it conditions a port, then
- waits for input for a login.
-
- It works ok if I start my own executable program, but if I try to
- fork & exec 'su -<usr>' to allow a standard login from that port, I
- get the following message on the port:
-
- Reset tty pgrp from <parent-pid> to <child-pid>
-
- If I ignore SIGHUP, I get this 'reset' msg about 24 times, then
- the child (su) dies.
-
- if I trap SIGHUP & write a debug-msg to a file, I get the message
- 2 times, and the child (su) runs on the port, but the parent dies
- ('Hangup'), after the debug-msg is written.
-
- - I'm running on SunOS 4.1.2
- - The port is not configured to run getty.
- - To dissociate the child from the parent, before
- the exec() call, I do the following:
- - close fd 0,1 & 2.
- - call setsid() to start a new session w this port as
- the controlling term.
- - open the port 2x for std in/out
- - dup stdout for stderr
- - I condition the port with standard stty settings
-
-
- Is there something else I need to do to remove the terminal from
- the process-group of the parent? Any help will be appreciated.
- --
- Joe Palumbos jmp@moscom.com {rit,tropix,ur-valhalla}!moscom!jmp
-