The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
wtmpx file is too big Vijayakumarpc SUN Solaris 6 01-04-2008 11:42 PM
wtmpx file aladdin UNIX for Dummies Questions & Answers 3 06-24-2007 10:54 AM
stop wtmpx logging hcclnoodles SUN Solaris 1 04-20-2007 05:31 AM
how to delete entry in file "wtmpx"(/var/adm/wtmpx) arm_naja UNIX for Advanced & Expert Users 4 03-08-2006 01:00 AM
Urgent problem with wtmpx Peterh UNIX for Dummies Questions & Answers 26 04-11-2003 08:38 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2004
finster's Avatar
Registered User
 

Join Date: Nov 2002
Location: USA
Posts: 75
wtmpx

Platform sol 8

I had wtmpx growing very large(1.2 G). I copied the file and compressed it the did a "cat /dev/null > /var/adm/wtmpx" to zero out the file and not close any doors to any processes. (After searching this seemed like the right method)

This is a box that gets accessed from other programs every 10 mins or so, which I expect that's why wtmpx grows so rapidly(1 gig in 2 months).

My question - is wtmpx just used for accounting (billing login time) and is it necessary to have or can it be disabled without any security issues? I know I can write a cron to clear it out(if this is the correct method) but if the box is not going to be used in an accounting way do I even need it to log this?
Reply With Quote
Forum Sponsor
  #2  
Old 06-21-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,653
wtmpx is used for more than accounting. I don't know what would happen if its missing, but I *think* that it would just be recreated.

A few commands that need it...

init
login
date
last
who

that's a lot of stuff to risk breaking.
Reply With Quote
  #3  
Old 06-21-2004
finster's Avatar
Registered User
 

Join Date: Nov 2002
Location: USA
Posts: 75
Should I save a copy before I "cat /dev/null " the file. If I need to keep a copy how can I read it and why? To check for security issues?

Also is this a proper method to clear the file and set up in a cron job?
Reply With Quote
  #4  
Old 06-21-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,653
With any log file, I usually keep some stuff. So I might effectively do something like:

mv wtmpx.2 wtmpx.3
mv wtmpx.1 wtmpx.2
cp wtmpx wtmpx.1
> wtmpx

But actually, it's been years since I've done stuff like that. There are log rotation tools that are very good and they are available for free. I like newsyslog. But there are others. See Log Rotation Tool/Script for some options. We have many other threads on this topic. Use our search function.

You can read wtmpx files with "who" or "last". See the man pages.
Reply With Quote
  #5  
Old 06-21-2004
finster's Avatar
Registered User
 

Join Date: Nov 2002
Location: USA
Posts: 75
Thanks, I will give it a try.


You used "> wtmpx"....is this better/same as using " cat /dev/null >var/adm/wtmpx"?

Does it matter? (I know you have to leave the pipe open to the file else restart a process but other than that I'm in the dark).
Reply With Quote
  #6  
Old 06-22-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,653
Both yield the same result. But
cat /dev/null > wtmpx
causes the shell to fork a copy of itself, open /dev/null, and exec the cat program. That's all needless activity.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0