Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
help... I deleted /var/log how do I fix it?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Sanjiyan
n00b
n00b


Joined: 29 Mar 2004
Posts: 39

PostPosted: Thu Aug 26, 2004 4:00 am    Post subject: help... I deleted /var/log how do I fix it? Reply with quote

All,

I did a stupid thing. I deleted /var/log thinking it would be OK to do so as the files in there were rather large.

Now my system starts up with errors such as the apache logs being missing, as such apache no longer works.

sshd etc complains about a /var/log/lastlog being missing also....

Anyone know how I can fix this? I finally got my gentoo box all up and working the way I wanted it, after setting it up (took me 2 weeks :( ) now I do this and I mess it up again, is there away to fix this while not having to reinstall everything?
Back to top
View user's profile Send private message
metallikop
Apprentice
Apprentice


Joined: 06 Jan 2004
Posts: 259
Location: Detroit, MI

PostPosted: Thu Aug 26, 2004 4:56 am    Post subject: Reply with quote

Oops ;)

Code:
mkdir /var/log
mkdir /var/log/apache2
touch /var/log/apache2/access_log
touch /var/log/apache2/error_log
touch /var/log/messages
touch /var/log/lastlog
touch /var/log/syslog
chown -R root:root /var/log
chown root:adm /var/log/syslog /var/log/messages /var/log/lastlog
Back to top
View user's profile Send private message
Sanjiyan
n00b
n00b


Joined: 29 Mar 2004
Posts: 39

PostPosted: Thu Aug 26, 2004 5:01 am    Post subject: Reply with quote

metallikop wrote:
Oops ;)

Code:
mkdir /var/log
mkdir /var/log/apache2
touch /var/log/apache2/access_log
touch /var/log/apache2/error_log
touch /var/log/messages
touch /var/log/lastlog
touch /var/log/syslog
chown -R root:root /var/log
chown root:adm /var/log/syslog /var/log/messages /var/log/lastlog


I did all that apart from the:
chown -R root:root /var/log
chown root:adm /var/log/syslog /var/log/messages /var/log/lastlog

I'll do that now, I had to make the syslog. :)

Many thanks is there a program I can use that rotates these logs? so I can delete the older ones? to stop me from messing this up again?

It all seems tobe working :)
Back to top
View user's profile Send private message
Red Sparrow
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2004
Posts: 128
Location: Greeley, CO

PostPosted: Thu Aug 26, 2004 5:13 am    Post subject: Reply with quote

Code:
emerge logrotate


syslog-ng also has a built-in rotating facility, but I haven't used it myself.

(- Steve -)
Back to top
View user's profile Send private message
Sanjiyan
n00b
n00b


Joined: 29 Mar 2004
Posts: 39

PostPosted: Thu Aug 26, 2004 6:04 am    Post subject: Reply with quote

Using logrotate, here is my config file for anyone who needs to use one as a basis for theirs:

Code:

nomail
olddir /var/log/rotated_logs
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.2 2004/07/18 01:58:24 dragonheart Exp$
#
# Logrotate default configuration file for Gentoo Linux
#
# See "man logrotate" for details

# rotate log files weekly
weekly
#daily

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones

# uncomment this if you want your log files compressed
compress

# packages can drop log rotation information into this directory
include /etc/logrotate.d

notifempty
nomail

# no packages own lastlog or wtmp -- we'll rotate them here
/var/log/wtmp {
        create 0664 root utmp
        rotate 1
}

# system-specific logs may be also be configured here.
/var/log/proftpd.log {
}
/var/log/cron.log {
}
/var/log/xferlog {
}
/var/log/kern.log {
}
/var/log/syslog {
}
/var/log/apache2/access_log {
}
/var/log/apache2/error_log {
}
/var/log/mysql/mysql.err {
}
/var/log/mysql/mysql.log {
}
/var/log/mysql/mysqld.err {
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum