home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / xenix / sco / 2866 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.9 KB  |  44 lines

  1. Newsgroups: comp.unix.xenix.sco
  2. Path: sparky!uunet!munnari.oz.au!uniwa.uwa.edu.au!DIALix!metapro!bernie
  3. From: bernie@metapro.DIALix.oz.au (Bernd Felsche)
  4. Subject: Re: '/etc/wtmp' how to control it's size
  5. Message-ID: <1992Sep7.023651.15037@metapro.DIALix.oz.au>
  6. Organization: MetaPro Systems, Perth, Western Australia
  7. References: <BtyEyJ.HrE@hsi.com> <1992Sep5.013608.21192@bilver.uucp> <1992Sep05.230657.7071@chinacat.unicom.com>
  8. Date: Mon, 7 Sep 92 02:36:51 GMT
  9. Lines: 33
  10.  
  11. In <1992Sep05.230657.7071@chinacat.unicom.com>
  12.    chip@chinacat.unicom.com (Chip Rosenthal) writes:
  13.  
  14. >In article <1992Sep5.013608.21192@bilver.uucp>
  15. >    bill@bilver.uucp (Bill Vermillion) writes:
  16. >>Don't mv /etc/wtmp to /etc/owtmp because the file is opened for writing
  17. >>and you will be writing to the old file.
  18.  
  19. >I do not think this is an issue.  The wtmp file is only opened briefly
  20. >at the time getty, init, etc. need to log an event.  So, yes, you
  21. >introduce a brief subsecond race condition.  ...
  22.  
  23. Not sure which UNIX you're talking about here.
  24.  
  25. >In theory the right way to handle wtmp file cleaning is to prune out
  26. >everything but the few records for the active sessions.  This is much
  27. >more complicated to do, and I've yet to run into a situation where I
  28. >really needed it.  Further, this is extremely difficult (if not
  29. >impossible) to do without introducing race conditions.
  30.  
  31. Well, I s'pose, yes. There's a small window.
  32.  
  33. Under System V, if you don't run process accounting, etc, then you can
  34. "safely truncate" the /etc/wtmp file as follows:
  35.     # cat /etc/utmp >/etc/wtmp
  36.  
  37. That ensures that all current sessions are in wtmp, and old ones are gone.
  38.  
  39. -- 
  40. +-----+ Bernd Felsche                     _--_|\  #include <std/disclaimer.h>
  41. | | | | MetaPro Systems Pty Ltd          /      \ bernie@metapro.DIALix.oz.au
  42. | | | | 328 Albany Highway,              X_.--._/         Fax: +61 9 472 3337
  43. |m|p|s| Victoria Park, Western Australia 6100  v        Phone: +61 9 362 9355
  44.