[comp.sys.mips] How to enable lastlogin info ?

bgm5902@rigel.tamu.edu (MOORE, BRIAN GEORGE) (02/06/91)

On our MIPS workstation (an RC2030 , RISC0s4.51) we apparently don't have
any of the accounting processes running, and that's as it should be, as
we only have a few users and no reason to charge anyone.  However, we'd
like to know the last login times for the various users. Currently if 
you finger any user (who is not logged on) it always says 
'Never logged in.'

I've tried reading some of the manual pages on the multitude of accounting
commands, and I've tried a few simple/stupid things like giving the command
'/usr/lib/acct/startup' as root, but it doesn't seem to be enough.
Also, there doesn't seem to be anything in the System Administrator's
Guide describing how to use the accounting stuff.

If anyone out there could give me a few pointers, it would be greatly
appreciated.

--
Brian Moore,  Chemistry Dept., Texas A&M university
bgm5902@rigel.tamu.edu

bgm5902@rigel.tamu.edu (MOORE, BRIAN GEORGE) (02/06/91)

Thanks for the replies!  There were two suggestions I received:

(1): touch file /etc/wtmp and use the last command.  This works, however
the last login field still does not appear on fingering and, more importantly,
it doesn't register logins made on our two Xwindow terminals via xdm.

(2): touch file /usr/adm/lastlog , chmod 644 of the same file.  This enables
the last login field of the finger command and appears to register the
xdm logins as well.

--
Brian Moore,  Chemistry Dept., Texas A&M university
bgm5902@rigel.tamu.edu

jay@mips.COM (Jay McCauley) (02/09/91)

In article <11814@helios.TAMU.EDU> bgm5902@rigel.tamu.edu writes:
>On our MIPS workstation (an RC2030 , RISC0s4.51) we apparently don't have
>any of the accounting processes running, and that's as it should be, as
>we only have a few users and no reason to charge anyone.  However, we'd
>like to know the last login times for the various users. Currently if 
>you finger any user (who is not logged on) it always says 
>'Never logged in.'
>
>I've tried reading some of the manual pages on the multitude of accounting
>commands, and I've tried a few simple/stupid things like giving the command
>'/usr/lib/acct/startup' as root, but it doesn't seem to be enough.
>Also, there doesn't seem to be anything in the System Administrator's
>Guide describing how to use the accounting stuff.
>
>If anyone out there could give me a few pointers, it would be greatly
>appreciated.
>
>--
>Brian Moore,  Chemistry Dept., Texas A&M university
>bgm5902@rigel.tamu.edu
There is, I believe, a brief discussion of how to enable System V accounting
in the release notes.  There is a script in /usr/lib/acct/install_acct
that makes a reasonable attempt to enable accounting and set up the
necessary startup/shutdown files and crontab entries.  Due to a bug
(mea culpa) this script must be executed in /usr/lib/acct on 4.51 systems.
There are manual pages for the accounting stuff in the Administrator Reference
Manual.  There are some commercially available books on UNIX System
Administration that discuss the care and feeding of System V accounting.
The support is "straight out of the box" with very little change from
the AT&T SVR3.2 baselines, so books which discuss System V accounting
will probably be applicable.

As you correctly observe this is kind of a fly killing sledge hammer.
(Note my admirable restraint in not making any Desert Storm allusions here...)
You will get the last login information, but will also get lots of other
reports that probably aren't extremely interesting.

There are some other alternatives:
1) the BSD 4.3 accounting is somewhat more "human scale".  You can run
BSD 4.3 or System V accounting (or none) but not both.  Again the release
notes have info on installing it.  The ac command summarizes usage.
2) there was a thread in this news group recently on enabling the
last login features in login and finger.  This may be all you need.
The quick summary:  touch the file /usr/adm/lastlog.  Alternatively,
there is information saved in $HOME/.lastlogin if the sentinal file
/etc/login.lastlogin.ok exists.  This is also discussed in the
login man page.  If you have /usr/adm/lastlog, the .lastlogin stuff
is redundant and vice versa.

Customer Support may have some more information, give 'em a call if this
isn't enough info.  (You DOOOO have a support contract, don't you?  [hint,hint])
-- 
Jay McCauley
MIPS Computer Systems, 928 E. Arques, Sunnyvale, CA 94086 (408)524-8211
{decwrl,pyramid,ames}!mips!jay         jay@mips.com