home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.xenix.sco
- Path: sparky!uunet!peora!tarpit!bilver!bill
- From: bill@bilver.uucp (Bill Vermillion)
- Subject: Re: '/etc/wtmp' how to control it's size
- Organization: W. J. Vermillion - Winter Park, FL
- Date: Sun, 6 Sep 1992 15:12:40 GMT
- Message-ID: <1992Sep6.151240.5461@bilver.uucp>
- References: <BtyEyJ.HrE@hsi.com> <1992Sep5.013608.21192@bilver.uucp> <1992Sep05.230657.7071@chinacat.unicom.com>
- Lines: 42
-
- In article <1992Sep05.230657.7071@chinacat.unicom.com> chip@chinacat.unicom.com (Chip Rosenthal) writes:
- >In article <1992Sep5.013608.21192@bilver.uucp>
- > bill@bilver.uucp (Bill Vermillion) writes:
-
- >>Don't mv /etc/wtmp to /etc/owtmp because the file is opened for writing
- >>and you will be writing to the old file.
-
- >I do not think this is an issue. The wtmp file is only opened briefly
- >at the time getty, init, etc. need to log an event. So, yes, you
- >introduce a brief subsecond race condition. ....
-
- >With all that said and done, I pretty much do as Bill suggested.
- >I think the best scheme would be something along the following:
-
- > >/etc/nwtmp
- > chmod 644 /etc/nwtmp
- > chown bin /etc/nwtmp
- > chgrp bin /etc/nwtmp
- > mv /etc/wtmp /etc/owtmp # race condition opened here
- > mv /etc/nwtmp /etc/wtmp # race condition closed here
-
- That's much cleaner.
-
- I seem to remember on an old system a long timg ago that I had problems
- with a system if you moved the wtmp to owtmp and created a new wtmp the
- pointer to the location for starting the write was the same as the last
- location written in the old file.
-
- So the copy and the >wtmp corrected that problem. And I honestly don't
- remember where/when I had the above problem, or on what machine/OS
- version.
-
- Thanks.
-
-
- Bill
-
- --
- Bill Vermillion - bill@bilver.oau.org bill.vermillion@oau.org
- - bill@bilver.uucp
- - ..!{peora|ge-dab|tous|tarpit}!bilver!bill
-
-