home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / ultrix / 6319 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  1.7 KB

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