Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
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.
I'm facing a problem with one of my servers related to the rotation of logs. When it reaches the log.2, it flushes all logs and stops logging unless I restart syslog.
For instance:
Mar 8 - secure
Mar 15 - secure.1
Mar 22 - secure.2
Mar 29 - previous logs lost and not logging anymore.
I manage like 50 servers and only this one is acting like this. What could be happening?
Check your logrotate settings are the same on this server.
Check your logs to see if syslog is failing at any point.
When you have to (re)start syslog is it actually running at the time.
As you haven't posted any of your logrotate settings relevant to that log that's about the only suggestions I can make.
Just noticed that this server had "rotate 2" while others had "rotate 4". That explains why the latest file with logs is the .2, however, that's not a reason to stop logging at all, it should start logging again in the first file.
Code:
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
In the server where this is happening, I got no syslog file. Instead I have syslog-ng. Content is the same as the others, just changing syslog for syslog-ng.
Ok, that's fine and expected if you're using syslog-ng.
At least we've your 2 / 4 sorted, I'd still check your logs to see if there's any errors related to syslog(-ng) and also my comments about checking to see if syslog is actually stopped or "hung" next time it happens.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.