Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-27-2005, 07:54 AM
|
#1
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Rep:
|
Deleted /var/log/messages, can't log any files-iptables
Hi
I have deleted the /var/log/messages file where all the log messages go into, and now when I do
#iptables -A INPUT -j LOG
the log file is empty. I have recreated an empty file'messages' at the same location, but none of my log files seems to go into it. Or do I have to changemode of the file?
--thanks--
|
|
|
02-27-2005, 08:03 AM
|
#2
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
Delete the file you created and tehn try running logrotate -f as root and that should re-create the missing messages file.
|
|
|
02-27-2005, 08:14 AM
|
#3
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
I have tried that, but the file is still missing.. I got this when I did logrotate -f
logrotate 3.6.8 - Copyright (C) 1995-2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License
Usage: logrotate [-d|--debug] [-f|--force] [-m|--mail command]
[-s|--state statefile] [-v|--verbose] [-?|--help] [--usage]
[OPTION...] <configfile>
please help!
|
|
|
02-27-2005, 08:51 AM
|
#4
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
When you see that word, it means that you haven't entered the command correctly. In this case, I should have been more complete in my answer. My apologies. In the future, when you see that Usage word, it us usually worth a quick look at the man page for that command to see what is missing.
What is missing is the path to the logrotate config file (logrotate.conf) which logrotate needs in order to do its thing. So the actualy complete command is
logrotate -f /path/to/logrotate.conf
On my system, logrotate.conf is in /etc so I would use logrotate -f /etc/logrotate.conf. However, your distro may put it somwhere else so have a look for it.
|
|
1 members found this post helpful.
|
02-27-2005, 09:05 AM
|
#5
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
Thank you so much for your kind reply, it has worked, the file was recovered. Thanks a LOT!
|
|
|
02-27-2005, 10:54 AM
|
#6
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
i don't understand this thread at all....
/var/log/messages will be created on demand if it doesn't exist.... logrotate may well create it, but you don't need to do anything at all. there was no problem in the first place.
|
|
|
02-27-2005, 01:03 PM
|
#7
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
Quote:
there was no problem in the first place.
|
Well, if you take his first post at face value, there was a problem in that iptables was no longer logging entries into the messages file he created and didn't appear to be creating a functional one. I don't know about you, but I have a tough time reading minds around here so I just told him a way to create a functional messages file. If the system would have made one on its own, well then bully for the system, but chingyenccy seems to be please with the answer I gave him.
|
|
|
02-27-2005, 04:03 PM
|
#8
|
Member
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108
Rep:
|
I think the problem was that message was removed while being kept open by the syslog daemon. To recover from that you can restart the daemon, which is probably what running logrotate did. To empty the file without removing it, use
>messages
|
|
|
All times are GMT -5. The time now is 12:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|