home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.xenix.sco
- Path: sparky!uunet!munnari.oz.au!uniwa.uwa.edu.au!DIALix!metapro!bernie
- From: bernie@metapro.DIALix.oz.au (Bernd Felsche)
- Subject: Re: '/etc/wtmp' how to control it's size
- Message-ID: <1992Sep7.023651.15037@metapro.DIALix.oz.au>
- Organization: MetaPro Systems, Perth, Western Australia
- References: <BtyEyJ.HrE@hsi.com> <1992Sep5.013608.21192@bilver.uucp> <1992Sep05.230657.7071@chinacat.unicom.com>
- Date: Mon, 7 Sep 92 02:36:51 GMT
- Lines: 33
-
- In <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. ...
-
- Not sure which UNIX you're talking about here.
-
- >In theory the right way to handle wtmp file cleaning is to prune out
- >everything but the few records for the active sessions. This is much
- >more complicated to do, and I've yet to run into a situation where I
- >really needed it. Further, this is extremely difficult (if not
- >impossible) to do without introducing race conditions.
-
- Well, I s'pose, yes. There's a small window.
-
- Under System V, if you don't run process accounting, etc, then you can
- "safely truncate" the /etc/wtmp file as follows:
- # cat /etc/utmp >/etc/wtmp
-
- That ensures that all current sessions are in wtmp, and old ones are gone.
-
- --
- +-----+ Bernd Felsche _--_|\ #include <std/disclaimer.h>
- | | | | MetaPro Systems Pty Ltd / \ bernie@metapro.DIALix.oz.au
- | | | | 328 Albany Highway, X_.--._/ Fax: +61 9 472 3337
- |m|p|s| Victoria Park, Western Australia 6100 v Phone: +61 9 362 9355
-