🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #164

Controlling Terminal question

#164
From: Joe Palumbos
Date: Tue, 28 Jul 1992 19:04
32 lines
1612 bytes
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
Technical Details
Message-ID: <3836@moscom.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!usc!rpi!batcomputer!cornell!rochester!galileo.cc.rochester.edu!ee.rochester.edu!moscom!jmp

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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