home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6561 < prev    next >
Encoding:
Text File  |  1992-07-23  |  2.0 KB  |  45 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!psinntp!pool!ujlh
  3. From: ujlh@pool.info.sunyit.edu (James Henrickson)
  4. Subject: Re: problems with who and w
  5. Message-ID: <1992Jul22.215419.6727@pool.info.sunyit.edu>
  6. Organization: State University of New York -- Institute of Technology
  7. References: <1992Jul20.170722.1@mcclb0.med.nyu.edu> <1992Jul21.223916.18114@ifi.uio.no>
  8. Date: Wed, 22 Jul 1992 21:54:19 GMT
  9. Lines: 34
  10.  
  11. In article <1992Jul21.223916.18114@ifi.uio.no> janl@ifi.uio.no (Jan Nicolai Langfeldt) writes:
  12. >
  13. >In article <1992Jul20.170722.1@mcclb0.med.nyu.edu>, ramirez@mcclb0.med.nyu.edu writes:
  14. >>     I am having a problem with who and w.  It is telling me that there are
  15. >> two users when there is only one.  It also says under the tty entry that the
  16. >> user is connected to ttyp1.  I've reset the machine and that user is still
  17. >> there.  Is there anything that I can do to get it off?
  18. >
  19. >This seems to be ripe for adding to the faq.
  20. >
  21. >The problem comes from a earlier improper logout (crash?), that left
  22. >the /etc/[uw]tmp files unupdated. I haven't seen (can't remember) a
  23. >better solutions so I offer this one: login as root, then type 'cd
  24. >/etc;', then 'rm [uw]tmp; touch [uw]tmp', then logout. The [wu]tmp
  25. >files are now empty, and when you login again 'w' and 'who' will
  26. >report the right number of users.
  27.  
  28. We used to have the same problem with a Xenix system until I wrote a little
  29. C program to add a logout entry in wtmp.  Unfortunately, I can't access
  30. that machine at the moment so I can't convert the program for Linux.  A
  31. suggestion for anyone thinking about writing a program that deals with
  32. important system files: test your programs on a COPY of the files involved,
  33. and make a backup of the files when you test the finished product.  I didn't
  34. learn this the hard way, but you can easily make a mess if people rely on
  35. these system files.  :-)
  36.  
  37. Just a helpful suggestion for new programmers.
  38.  
  39.  
  40. -- 
  41. Jim H.
  42. *
  43. * James L. Henrickson                                 ujlh@sunyit.edu
  44. * "Yet another Jim in the Linux world."  :-)
  45.