home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!reed!nelson
- From: nelson@reed.edu (Nelson Minar)
- Newsgroups: comp.unix.ultrix
- Subject: Re: w and ps don't agree
- Message-ID: <1992Aug19.084554.10580@reed.edu>
- Date: 19 Aug 92 08:45:54 GMT
- Article-I.D.: reed.1992Aug19.084554.10580
- References: <1992Aug17.081549.12346@trl.oz.au> <Bt6Lty.Cv7@ef2007.efhd.ford.com> <1992Aug19.071445.4360@ircam.fr>
- Organization: Reed College, Portland, OR
- Lines: 32
-
- In article <1992Aug19.071445.4360@ircam.fr> fingerhu@ircam.fr (Michel Fingerhut) writes:
- >>/etc/utmp is hosed.
- >>one could just "cat /dev/null > /etc/utmp" and it'll rebuild itself.
-
- (but don't rm /etc/utmp - a lot of the software doesn't deal with
- that very well)
-
- >Well, not good enough. the only way I found was to reboot. Any other ideas?
-
- yeah, just edit the utmp.
-
- There's bound to be 6000 pieces of software that will all edit the
- utmp. I could write an emacs mode for it in 15 minutes, and I have
- written C code to edit /etc/utmp (in a specific way, not to wipe out
- the old entries). But the problem doesn't show up often enough to be
- worth the trouble of writing Real Software.
-
- What I usually do is load /etc/utmp up in emacs, find the offending
- tty entry, find the name of the user, and replace the first character
- with a null. Seems to work good enough. Wiping the entire entry with
- nulls is probably better, but takes more keystrokes.
-
- Documentation for the file format of /etc/utmp can be found in
- /usr/include/utmp.h
-
- The easiest way to create these utmp entries is to create a shell
- without a utmp (via xterm, or rsh, or your favourite mechanism), run
- /bin/login from the shell, and then exit. The utmp doesn't seem to be
- cleaned out for some reason.
- --
- __
- nelson@reed.edu \/ All things are true
-