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.