Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Deleted WTMP file, help recreating 1

Status
Not open for further replies.

texasitalian

IS-IT--Management
Aug 11, 2003
39
US
Newbie here,
I was incorrectly told that to diminish the size of my log file wtmp in /var/adm was to rm wtmp then recreate it.
Now the command last does not work.
what do I do now?
Any directions would be appreciated

Malcolm Fowler
 
the 'last' command uses the wtmp and wtmpx files. If you have deleted the file then the last info has gone.
 
To clarify:
I tried the command last and it returned the error "path not found" so I recreated wtmp in the /var/adm path and last seemed to work, but only shows the current and only root login.
in other words it shows #wtmp begins Jan 06 07:07

so it seems that a daemon is not working now, or the file is corrupt or incorrectly created.
Any direction is much appreciated

Malcolm Fowler
 
The wmtp file contains the login details displayed by the last command. When you recreate a blank wmtp file then there is nothing for the ;ast command to output (until users login and the wmtp file is updated).
 
you are correct. However, since I recreated the wtmp file, users have logged in and the command last still shows only the same #wtmp begins Jan 06 07:07

so it seems that the updating of the other information is not working, right?

I do appreciate your help!
Malcolm Fowler
 
What do the ownership and permissions look like?

On my server:
-rw-rw-r-- 1 adm adm 1900864 Jan 06 15:21 wtmp

"If you always do what you've always done, you will always be where you've always been."
 
the permissions I show are:

drwxr-xr-x 2 root system 512 Nov 25 11:52 wtmp

and I noticed that my acct is

drwxrwxr-x 5 adm adm 512 Jan 17 2003 acct

this is the issue right?

Malcolm Fowler
 
according to this
drwxr-xr-x 2 root system 512 Nov 25 11:52 wtmp

the wmtp is a directory and not a file.
 
My acct:
-rw-rw-r-- 1 adm adm 1900864 Jan 06 15:21 wtmp

Your permissions and ownership need to change.




"If you always do what you've always done, you will always be where you've always been."
 
to resolve do the following.

cd /var/adm
rmdir wmtp
cat /dev/null >wmtp

 
ok.
Great Job! I give you a star! thanks a bunch!

Malcolm Fowler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top