[comp.unix.xenix] problems with ungetty

paterra@cs.odu.edu (Frank C. Paterra) (08/20/90)

I'm having some problems with using a phone liune for both dial
in and dial out.  Here is the set up

sco xenix 2.2.3, ps/2 model 80 ('386)
anvil stallion 16 port intel. card
2 telephone lines with hayes comp. modems

Ok, The two lines, tty400 and tty401, are both enabled and they
re owned by uucp and in group uucp.  When nobody is calling out
and I look at the permissions, theyar are both set for -rw--w--w
.  When ungetty is run (by either pcomm or uucico) the line is
shown as in use.  When I type ungetty at the unix prompt and
check the return code, it shows that hte line is successfully
disabled, but if I then do a ps, I see that a getty is still
running.  ungetty is owned by uucp.  I tryed making it owned by
root, but that did no good either.

So what is wrong?  What can I do?

--
Frank Paterra
paterra@cs.odu.edu

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (08/20/90)

In article <PATERRA.90Aug19131214@raedwald.cs.odu.edu> paterra@cs.odu.edu (Frank C. Paterra) writes:

| Ok, The two lines, tty400 and tty401, are both enabled and they
| re owned by uucp and in group uucp.  When nobody is calling out
| and I look at the permissions, theyar are both set for -rw--w--w
| .  When ungetty is run (by either pcomm or uucico) the line is
| shown as in use.  When I type ungetty at the unix prompt and
| check the return code, it shows that hte line is successfully
| disabled, but if I then do a ps, I see that a getty is still
| running.  

  Sounds right to me. The way it should work is that ungetty sends a
signal to getty, and getty closes the tty so the next process can use
it. When that process is finished it should send *another* signal to
getty to tell it to terminate. Then init will restart another getty on
the line, to repeat the init code.

  I would expect the getty to still be there, but I can't try it because
every line on this system is busy.
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me

campbell@Thalatta.COM (Bill Campbell) (08/20/90)

In article <PATERRA.90Aug19131214@raedwald.cs.odu.edu> paterra@cs.odu.edu (Frank C. Paterra) writes:
:I'm having some problems with using a phone liune for both dial
:in and dial out.  Here is the set up
:
:sco xenix 2.2.3, ps/2 model 80 ('386)
:anvil stallion 16 port intel. card
:2 telephone lines with hayes comp. modems
:
:Ok, The two lines, tty400 and tty401, are both enabled and they
:re owned by uucp and in group uucp.  When nobody is calling out
:and I look at the permissions, theyar are both set for -rw--w--w
:.  When ungetty is run (by either pcomm or uucico) the line is
:shown as in use.  When I type ungetty at the unix prompt and
:check the return code, it shows that hte line is successfully
:disabled, but if I then do a ps, I see that a getty is still
:running.  ungetty is owned by uucp.  I tryed making it owned by
:root, but that did no good either.
:
:So what is wrong?  What can I do?
:
:--
:Frank Paterra
:paterra@cs.odu.edu

I think there may be a problem with your modem or the Stallion
drivers.  getty shouldn't even be running unless CD is up on the
modem line.  Would it be logical for getty to get out of the way
if it thought it was in the process of answering an incoming call?
-- 
....microsoft--\                    Bill Campbell; Celestial Software
...uw-entropy----!thebes!camco!bill 6641 East Mercer Way
....fluke------/                    Mercer Island, Wa 98040
....hplsla----/                     (206) 232-4164

barton@holston.UUCP (Barton A. Fisk) (08/21/90)

In article <PATERRA.90Aug19131214@raedwald.cs.odu.edu>, paterra@cs.odu.edu (Frank C. Paterra) writes:
> I'm having some problems with using a phone liune for both dial
> in and dial out.  Here is the set up


Note that ungetty in 2.2.1 must run suid to root. (may be different
in later versions)

-rws--x--x   1 root  uucp  13240 May 12  1987 /usr/lib/uucp/ungetty

You may find out more about what is actually causing the problem
by running uucico in debug mode -x9 and watching the activity.

Hope this helps you.
-- 
uucp: holston!barton

cat@tygra.ddmi.com (CAT-TALK Maint. Account) (08/21/90)

In article <5476@thebes.Thalatta.COM> campbell@Thalatta.COM (Bill Campbell) writes:
}
}I think there may be a problem with your modem or the Stallion
}drivers.  getty shouldn't even be running unless CD is up on the
}modem line.  Would it be logical for getty to get out of the way
}if it thought it was in the process of answering an incoming call?
}-- 

WRONG! getty's are spawned by init when (1) the system is started and
(2) When someone logs off (ie: login process terminates) or when the
current getty on the line dies. CD is only up when someone has dialed
in. Getty is also present when no one is connected. It simply waits
for a call to come in, and then prints the first "login:" prompt. When 
someone types in a login  id, it exec's /etc/login (or /bin/login) with
the string typed by the user as its argument. /etc/login validates the
user (makes sure he types in the correct password) then takes care of
some other login accounting, then exec's the user's login shell as listed
in /etc/passwd.

wht@n4hgf.Mt-Park.GA.US (Warren Tucker) (08/21/90)

In article <360@tygra.ddmi.com> cat@tygra.UUCP (CAT-TALK Maint. Account) writes:
>In article <5476@thebes.Thalatta.COM> campbell@Thalatta.COM (Bill Campbell) writes:
>}
>}getty shouldn't even be running unless CD is up on the
>}modem line.
>
>WRONG! getty's are spawned by init when (1) the system is started

Actually, you are both "right" :-). Bill is describing the BSD approach
while 'cat' is talking about System V.  XENIX, of course, uses the System
V approach (mostly; Microsoft hung the BSD /etc/ttys bag off the side
of init).
 
-----------------------------------------------------------------------
Warren Tucker, TuckerWare   gatech!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
"Tell the moon; don't tell the March Hare: He is here. Do look around."

pmb@sequim.UUCP (Peter Black) (08/22/90)

> In article <PATERRA.90Aug19131214@raedwald.cs.odu.edu> paterra@cs.odu.edu (Frank C. Paterra) writes:
> :I'm having some problems with using a phone liune for both dial
> :in and dial out.

Getty still runs but won't do anything until signaled to do so.

You didn't say whether the problem was dial in or dial out.  If dial
out, then your problem may be with the Devices file.  It should read
something like this:

    ACU tty400 - 1200 /usr/lib/uucp/dialHA12
    ACU tty401 - 1200-2400 /usr/lib/uucp/dialHA24
    ACU tty402 - 2400 /usr/lib/uucp/dialHA24
    Direct tty000 - 1200 direct
    Direct tty001 - 2400 direct
    Direct tty002 - 2400 direct

If your problem is dial in, then you need to check /etc/gettydefs,
/etc/inittab, /etc/ttys to be sure you the system software is using
the right baud rate for the modem.

Peter M. Black, Peter M. Black Real Estate Co., Inc.
P.O. Box 2227, 315 E. Washington Street, Sequim, WA 98382
Voice (PDT): (206) 683-1171 or 800-962-7307, FAX: (206) 683-5415
E-Mail: {attmail,uunet}!sequim!pmb

rob@lafayet.UUCP (Rob Freyder) (08/22/90)

In <5476@thebes.Thalatta.COM> campbell@Thalatta.COM (Bill Campbell) writes:

>In article <PATERRA.90Aug19131214@raedwald.cs.odu.edu> paterra@cs.odu.edu (Frank C. Paterra) writes:
>:I'm having some problems with using a phone liune for both dial
>:in and dial out.  Here is the set up
>:anvil stallion 16 port intel. card

What version of the driver do you use ?

>:
>:So what is wrong?  What can I do?
>:Frank Paterra
>I think there may be a problem with your modem or the Stallion
>drivers.  getty shouldn't even be running unless CD is up on the
>....microsoft--\                    Bill Campbell; Celestial Software

Bingo.  The stallion drivers prior to 2.6.2 are broken for dialin/dialout.
When I got the release notes for 2.6.2 they said something like bi-directional 
usage was now "properly supported".  I also seem to recall that they use a
nonstandard cable config for modems.

BTW, getty does run regardless of CD. (under Xenix anyway).
-- 
Rob Freyder                                  Core Laboratories a division of
____    ____     ____                        Western Atlas International Inc.
\   \  /   /\   /   /\                       =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 \   \/   /  \ /   /  \                      Humans     (318) 235-9431
  \  /   / \  /   /\   \                     Internet   rob@lafayet.UUCP
   \/___/   \/___/  \___\                    Bang    ...!uunet!rouge!lafayet!rob

simon@ms.uky.edu (G. Simon Gales) (08/23/90)

There is no problem.  Ungetty tells the getty process to close
the tty port, not to terminate.  Getty remains, but ignores the
port, so that another program can use it without interference.

When the getty is killed off, as it should be after ungetty'ing
it and when your prog is finished with the port, /etc/init will
start another one on that port.

-- 
               Simon Gales@The University of Kentucky
   simon@ms.uky.edu    simon@UKMA.BITNET   {rutgers, uunet}!ukma!simon

 Power is danger.  -- The Centurion, "Balance of Terror," stardate 1709.2.

jcg@tree.uucp (Chris Gonnerman) (08/28/90)

We are running XENIX System V and are having extensive problems with out
dial-in/dial-out port also.  We are using a SupraModem 2400 and have
experienced the same problems using it on a multiport board and on
"COM1" (tty1A).

We have a line in Devices that looks like:

ACU tty3A - 1200-2400 /usr/lib/uucp/dialHA24

The port is enabled as usual.  After some (but not all) uucp dial-outs,
the port will "hang" in one or both of these ways:

- modem not returned to ATS0=1 (won't autoanswer)
- getty won't respond after connection

This has been verified to happen only after uucp dial-outs, and seems to
occur randomly otherwise (i.e. successful vs. unsuccessful connections
make no difference).

The system worked flawlessly until just recently.  We installed the most
recent upgrade to XENIX (I forget what number exactly) about 1 month
ago, but the problem first started just before the upgrade (1 week
prior), indicating that the upgrade should not be to blame.

I have run out of ideas.  Any suggestions?

-- 
 +----------------------------------------------------------------------------+
 | Chris Gonnerman (Mad Programmer At Large)   csusac.ecs.csus.edu!tree!jcg   |
 | @ the Tree BBS, Sacramento, CA              ucbvax!ucdavis!csusac!tree!jcg |
 +----------  DISCLAIMER: These opinions are mine... MINE, I say!  -----------+

neal@mnopltd.UUCP (08/31/90)

->We are running XENIX System V and are having extensive problems with out
->dial-in/dial-out port also.  We are using a SupraModem 2400 and have
->experienced the same problems using it on a multiport board and on
->"COM1" (tty1A).
->
->We have a line in Devices that looks like:
->
->ACU tty3A - 1200-2400 /usr/lib/uucp/dialHA24
->
->The port is enabled as usual.  After some (but not all) uucp dial-outs,
->the port will "hang" in one or both of these ways:
->
->- modem not returned to ATS0=1 (won't autoanswer)
->- getty won't respond after connection
->
->This has been verified to happen only after uucp dial-outs, and seems to
->occur randomly otherwise (i.e. successful vs. unsuccessful connections
->make no difference).

I can only commiserate.  I recently started leaving my Tbit enabled for 
login all the time.  And noticed that DTR often drops after uucp uses it.  
Lacking time to fiddle,  I took the brute force approach of disable/enable
afterwards, which somewhat helps.   


------------------------------------------------------------------------------
Neal Rhodes                       MNOP Ltd                     (404)- 972-5430
President                Lilburn (atlanta) GA 30247             Fax:  978-4741
                             emory!mnopltd!neal 
------------------------------------------------------------------------------

wht@n4hgf.Mt-Park.GA.US (Warren Tucker) (09/01/90)

In article <111@mnopltd.UUCP> gatech!stiatl!mnopltd!neal writes:
>
>->We are running XENIX System V and are having extensive problems with out
>->dial-in/dial-out port also.  
>->We have a line in Devices that looks like:
>->ACU tty3A - 1200-2400 /usr/lib/uucp/dialHA24
>->- modem not returned to ATS0=1 (won't autoanswer)
>->- getty won't respond after connection
>
>I can only commiserate.

Make sure the tty is labelled a "dialup" in
/etc/ttytype.  When getty starts on a line with a tty
of type "dialup", it examines the Devices file to find
the dialer: if the dialer is a program, it runs it with
the -h switch before starting getty; if it is a Dialers
entry, say "hayes24", it runs the Dialers script,
prepending "&", which would be "&hayes24" in this
example.
 
-----------------------------------------------------------------------
Warren Tucker, March Hare   gatech!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
"Tell the moon; don't tell the March Hare:  He is here to look around."

bblue@crash.cts.com (Bill Blue) (09/03/90)

In article <197@n4hgf.Mt-Park.GA.US> wht@n4hgf.UUCP (Warren Tucker) writes:
>In article <111@mnopltd.UUCP> gatech!stiatl!mnopltd!neal writes:
>>
>>->We are running XENIX System V and are having extensive problems with out
>>->dial-in/dial-out port also.  
>>->We have a line in Devices that looks like:
>>->ACU tty3A - 1200-2400 /usr/lib/uucp/dialHA24
>>->- modem not returned to ATS0=1 (won't autoanswer)
>>->- getty won't respond after connection
>>
>>I can only commiserate.
>
>Make sure the tty is labelled a "dialup" in
>/etc/ttytype.  When getty starts on a line with a tty
>of type "dialup", it examines the Devices file to find
>the dialer: if the dialer is a program, it runs it with
>the -h switch before starting getty; if it is a Dialers
>entry, say "hayes24", it runs the Dialers script,
>prepending "&", which would be "&hayes24" in this
>example.

I've never found this to matter.  The only thing that seems to matter
is that the modem control port (A versus a) appear in Devices.  And
if there is also a Direct entry in Devices for the non-modem control
version of the port, it must appear AFTER the modem control entry.
So

ACU tty3A - 1200-2400 dialHA24
Direct tty3a - 1200-2400 direct

will work correctly.  But if the lines above were reversed, the modem
would not be turned around after the call.  I have four two-way ports
defined on crash, and only one of them has 'dialup' in /etc/ttytype
(only because it never got changed to anything else).  All of them
behave identically.  Can anyone at SCO say what the keyword 'dialup'
is really supposed to do, if anything?

I'm also assuming that tty3[Aa] on the original poster's machine is
a legitimate two-way serial port, since it isn't normally part of Xenix.

--Bill Blue