[comp.sys.sequent] why does who not show rlogin-users

pwolfe@kailand.KAI.COM (06/08/89)

> /* Written by jand@maestro.htsa.aha.nl */
> Can anyone tell me why I'm not registered in /etc/utmp if I'm logged
> in from another system or use rlogin `hostname` ?
> On the Balance we have here, only 'real tty' users are shown with 'who'.
> The same goes for rwho, but rwho won't even show the users on other
> machines (though this may be an unrelated problem).
> Jan Derriks.

Entries are made in /etc/utmp only for terminals that appear in /etc/ttys.  The
"who" and "rwhod" programs use /etc/utmp to identify who is logged on.

You need to edit your /etc/ttys file and add a line for each pseudo terminal
that is defined (ls /dev/ttyp?).  Remember Sequent has a unique pty naming
scheme (ttyp[0-9][a-zA-Z]).  Pseudo terminals should have a zero in column one,
so getty's will not be started for them.

I believe a reboot may be neccessary for this change to become effective.  In
fact, it's probably not a great idea to edit /etc/ttys while the system is
running multi user, since it could cause some programs to work incorrectly.  It
should be okay as long as you don't insert or delete any data in the middle.
If you substitute the same length data, or add on to the end of the file, no
problems should occur.

From our /etc/ttys file on our Balance:
	12ttyc0
	0cttyc1
	10ttyd0
	[ lines deleted ]
	02ttyhf
	02ttyp0
	[ lines deleted ]
	02ttyp9
	02ttypa
	[ lines deleted ]
	02ttypz
	02ttypA
	[ lines deleted ]
	02ttypY
	02ttypZ

Your rwho problem is probably related.  Rwhod only broadcasts info about
terminals that have entries in /etc/utmp.  In fact, every program that uses the
"getlogin()" system call (such as talk, su) will not be able to identify you,
unless they use "getpwuid(getuid())" when getlogin() returns NULL.  Make sure
the /etc/ttys file is updated on all machines across your network, and your
rwho program should work okay.

If your rwho doesn't acknowledge the existence of another host that you *know*
is running rwhod, check the broadcast address being used.  The broadcast
address changed between BSD 4.2 and 4.3 (from 0.0.0.0 to 255.255.255.255).  You
may have to alter the /etc/ifconfig command line in /etc/rc.local to cause all
your systems to use the same broadcast address.

Patrick Wolfe	(pat@kai.com, {uunet,uiucuxc,sequent}!kailand!pat)
System Manager, Kuck and Associates, Inc.

pwolfe@kailand.KAI.COM (06/10/89)

> /* Written by phil@sequent.UUCP in kailand:comp.sys.sequent */
> In article <964@maestro.htsa.aha.nl> jand@maestro.htsa.aha.nl (Jan Derriks) writes:
> | Is this bug is a way of getting over the 32 user limit ?
> Nope!

Yep!  Since /bin/login counts users by counting entries in /etc/utmp, if you
are missing entries for some real or pseudo terminals in /etc/ttys, those
logins don't get counted.

I asked Sequent to find a better way to count logins back in early 1988, when I
installed Screen V2.0, which had a new feature of adding entries to /etc/utmp
for each window it created.  Screen didn't count the existing /etc/utmp entries
to make sure we didn't go over our limited user limit (and it shouldn't have
to, since I don't think each window of a virtual terminal manager should be
considered a separate login), and the next person to really login caused the
system to panic "illegal number of users".

Sequent Customer Service's official responce was "this will not be changed",
and now that I understand the next release of Dynix will be based on System V
(release 2? 3?), I guess I understand why they are reluctant to spend any time
fixing non-serious bugs in the current release.  I've since fixed Screen to
(among other things) count logins (like /bin/login does) before adding any
entries to utmp, and to allow each user to selectively "login" or "unlogin"
windows at will.

How does BSD 4.3 count logins?  I've seen the quota checks in 4.3 tahoe's
/bin/login (anonymously ftp'able from uunet.uu.net), but don't know where/how
the data is actually stored and modified.

We've run into problems when someone's session gets killed, but the entry in
utmp doesn't get removed.  They don't have any processes running, but they
still show up in "w" or "who", and they also take up one of those precious user
slots (one of our machines has only a 16 user license, and we have approx 20
people that want to use it).  I've written a program to zero out specified
entries from the utmp file, which I use to fix this problem (since the only
other workaround is to reboot).

While I only use my program to fix problems, a dishonest system administrator
might use something similar to it in /etc/.login, so their site would never
have to upgrade their user license (which is pretty cheap anyway).

Also, if someone wanted to port that BSD 4.3 Tahoe /bin/login program, or
install the one that passed through the source newsgroups earlier this year,
they wouldn't run into user license limit problems (except possibly problems
of the legal type, of course).

Patrick Wolfe	(pat@kai.com, {uunet,uiucuxc,alliant,sequent}!kailand!pat)
System Manager, Kuck and Associates, Inc.
"The opinions expressed here are strictly my own, and not neccessarily
those of the company I work for.  Please don't call my boss (again)."

jackg@sequent.UUCP (Jack Griffith) (09/27/89)

I wanted to respond to some much earlier discussion regarding number of
users as indicated by utmp and the # of users allowed to login to the
system.  I've recently run across an implementation of an undocumented
library routine that will add the utmp entries for you.

The "logic" with which init counts the number of users is to
consider all of those with NULL host entries as direct tty ports
and an individual user.  Those with the same non-NULL host entry
and user name will be counted as one user.  Window SW needs to adhere
to this in order to add new users without init thinking that you've
gone beyond the user limit and bringing you down to single user
(what Patrick Wolfe referred to as the panic regarding this).

It is obviously prudent, given the drastic course that init
takes, to checking your number of users against the limit before
you go to try to add a new user.  login does this as well as Sequent's
flavor of xterm in S-Windows.

The "preferred" method of this is to use add_utmp(3) which is
currently undocumented (which has been recorded as a bug).
It has the magic to check the number of user's in it and
to return -1 when you've exceeded the usrlimit rather than
getting "nailed" by init.

add_utmp takes two params ...slot is the tty slot (pseudotty slot
that you just acquired) to add and up is the utmp entry that you
wish to add (stuff and play).

/*
 * add_utmp
 *	Add utmp entry to utmp file
 *	Return 0 for success, -1 for error or usr limit reached
 */
add_utmp(slot, up)
	int	slot;
	struct	utmp *up;

________________________

Jack Griffith
Customer Service
Sequent Computer Systems
uunet!sequent!jackg
(800) 854-9969
_________________________