From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,aba853471ae7339,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 10b612,aba853471ae7339,start X-Google-Attributes: gid10b612,public X-Google-ArrivalTime: 1991-10-15 06:22:01 PST Path: gmdzi!unido!mcsun!uunet!cs.utexas.edu!natinst!uudell!bigtex!texsun!csccat!ncmicro!ltf From: ltf@ncmicro.lonestar.org (Lance Franklin) Newsgroups: comp.unix.ultrix,comp.sys.dec Subject: getty line-sharing questions Message-ID: <497@ncmicro.lonestar.org> Date: 14 Oct 91 21:52:44 GMT Followup-To: comp.unix.ultrix Organization: NC Microproducts, Inc. Richardson, Tx Xref: gmdzi comp.unix.ultrix:48142 comp.sys.dec:25564 Here's a quick question...in trying to bring up a new getty program for Ultrix 4.2, I'm having a bit of a problem getting it to work in shared mode with uucp, etc. I've seen examples of sharing a serial port using TIOCSINUSE in tip/cu/uucp type programs, but none for a getty-type program, where the program sits on the port waiting for activity. the getty program I'm playing with does the following: /* * getty -- adapt to terminal speed on dialup, and call login * * Melbourne getty, June 83, kre. */ ... [stuff deleted to get to the good stuff] ... strcpy(ttyn, dev); strncat(ttyn, argv[2], sizeof(ttyn)-sizeof(dev)); if (strcmp(argv[0], "+") != 0) { chown(ttyn, 0, 0); chmod(ttyn, 0622); /* * Delay the open so DTR stays down long enough to be detected. */ sleep(2); close(0); close(1); vhangup(); while (open(ttyn, O_RDWR) != 0) { if (repcnt % 10 == 0) { syslog(LOG_ERR, "%s: %m", ttyn); closelog(); } repcnt++; sleep(60); } signal(SIGHUP, SIG_IGN); (void) open(ttyn, O_RDWR); close(0); dup(1); dup(0); signal(SIGHUP, SIG_DFL); } } Now, I'm not quite sure I understand why the two opens, and which one sits and waits for activity. And I'm sure somewhere in this code, there needs to be an ioctl that tells other programs that the tty's in use, but I'm a bit lost as to what actually happens here. Can anybody help me? By the way, does anybody have a clue as to why the Ultrix getty should suddenly begin dropping incoming calls? Outgoing calls are fine, but for some reason, the modem is dropping off almost immediatly after the carrier is detected, with no apparent conversations intervening. With the above newgetty, no problems with incoming calls, but outgoing calls via uucico are not working, due to newgetty grabbing the line as unshared. Lance -- Lance T. Franklin +----------------------------------------------+ (ltf@ncmicro.lonestar.org) | "You want I should bop you with this here | NC Microproducts, Inc. | Lollipop?!?" The Fat Fury | Richardson, Texas +----------------------------------------------+