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

  1. Newsgroups: comp.unix.xenix.sco
  2. Path: sparky!uunet!peora!tarpit!bilver!bill
  3. From: bill@bilver.uucp (Bill Vermillion)
  4. Subject: Re: '/etc/wtmp' how to control it's size
  5. Organization: W. J. Vermillion - Winter Park, FL
  6. Date: Sun, 6 Sep 1992 15:12:40 GMT
  7. Message-ID: <1992Sep6.151240.5461@bilver.uucp>
  8. References: <BtyEyJ.HrE@hsi.com> <1992Sep5.013608.21192@bilver.uucp> <1992Sep05.230657.7071@chinacat.unicom.com>
  9. Lines: 42
  10.  
  11. In article <1992Sep05.230657.7071@chinacat.unicom.com> chip@chinacat.unicom.com (Chip Rosenthal) writes:
  12. >In article <1992Sep5.013608.21192@bilver.uucp>
  13. >    bill@bilver.uucp (Bill Vermillion) writes:
  14.  
  15. >>Don't mv /etc/wtmp to /etc/owtmp because the file is opened for writing
  16. >>and you will be writing to the old file.
  17.  
  18. >I do not think this is an issue.  The wtmp file is only opened briefly
  19. >at the time getty, init, etc. need to log an event.  So, yes, you
  20. >introduce a brief subsecond race condition.  ....
  21.  
  22. >With all that said and done, I pretty much do as Bill suggested.
  23. >I think the best scheme would be something along the following:
  24.  
  25. >    >/etc/nwtmp
  26. >    chmod 644 /etc/nwtmp
  27. >    chown bin /etc/nwtmp
  28. >    chgrp bin /etc/nwtmp
  29. >    mv /etc/wtmp /etc/owtmp        # race condition opened here
  30. >    mv /etc/nwtmp /etc/wtmp        # race condition closed here
  31.  
  32. That's much cleaner. 
  33.  
  34. I seem to remember on an old system a long timg ago that I had problems
  35. with a system if you moved the wtmp to owtmp and created a new wtmp the
  36. pointer to the location for starting the write was the same as the last
  37. location written in the old file.
  38.  
  39. So the copy and the >wtmp corrected that problem.  And I honestly don't
  40. remember where/when I had the above problem, or on what machine/OS
  41. version.
  42.  
  43. Thanks.
  44.  
  45.  
  46. Bill
  47.  
  48. -- 
  49. Bill Vermillion - bill@bilver.oau.org  bill.vermillion@oau.org
  50.                 - bill@bilver.uucp 
  51.                 - ..!{peora|ge-dab|tous|tarpit}!bilver!bill
  52.  
  53.