Path: utzoo!attcan!uunet!lll-winken!sun-barr!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!bloom-beacon!eru!luth!sunic!isgate!hafro!heimir From: heimir@hafro.is (Heimir Sverrisson) Newsgroups: comp.unix.i386 Subject: Spawning a login on a pty Keywords: login, pty, i386 Message-ID: <177@hafro.is> Date: 1 Aug 90 00:45:28 GMT Organization: Marine Research Institute, Reykjavik Lines: 29 I've been trying to start up a login process on the slave side of a pty from an application that controls the master side. I need this for an application that must take the user through the getty->login->sh phase. My approach was simply to fork-exec a '/etc/getty /dev/ttypX' and talk to the '/dev/ptypX' device. This was fine until the 'sh' was about to be started -- then I got this strange message of 'no utmp entry' and to 'exec from the login shell'. I did try to double-fork to make the /etc/getty an orphan, then I made it a process group leader (using setpgrp(2)) -- still w.o. any luck. At last I got the damn thing to work by writing a 'fake' utmp entry to /etc/utmp using pututline(3). Then the problem is to keep the utmp-entry up to date, i.e. when the user logs out of the pty. My question to the net is: Is this the way to go? How do window- managers, telnetd and rlogind do this? How portable is it, will it work in BSD environment, POSIX, AIX, MACH ? I'll summarize if I get any usable answers. -- Heimir Thor Sverrisson heimir@hafro.is -- --- Heimir Thor Sverrisson Uucp: mcsun!isgate!hafro!heimir Internet: heimir@hafro.is