Solve the problem that syslog does not write logs to log files

Source: Internet
Author: User
Solve the problem that syslog does not write logs to log files-Linux Enterprise Application-Linux server application information. The following is a detailed description. Recently modified the log file/etc/syslog of the company server. conf. The syslogd of the two servers no longer writes logs to any log file. Use ps-ef | grep syslog To find that syslogd is running:

[Root @ host103 ~] # Ps-ef | grep syslog
Root 10058 6976 0 00:00:00 pts/1 man syslogd
Root 12062 1 0 21:48? 00:00:00 syslogd-m 0
Root 12315 11589 0 00:00:00 pts/4 grep syslog

[Root @ host103 ~] # Service syslog status
Syslogd (pid 12062) is running...
Klogd (pid 12066) is running...

But the size of all log files is empty. Use logger test/var/log/messages, and then open/var/log/messages. It is found that the previous test information is not written into the log file. It takes a long time to think about it, no answer is found.

Later, ask a colleague to check the/etc/syslog on other servers. conf and/etc/init. d/syslog copy to the faulty machine (the log configurations of the two machines are identical), and then restart syslog/etc/init. d/syslog restart. The problem is solved.

Where is the problem?
I used diff to compare/etc/syslog. conf (new) and/etc/syslog. conf (old), no difference, old/etc/init. d/syslog (old) and/etc/init. d/syslog (new), there is no difference, the results I use the following command, we found that the date of the two files is different:

[Root @ host103 ~] # Ll/etc/init. d/syslog *
-Rwxr-xr-x 1 root 1369 Aug 16/etc/init. d/syslog
-Rwxr-xr-x 1 root 1369 Feb 22 2005/etc/init. d/syslog. old

The date of the old file has changed. Then I copy the old file and name it/etc/init. d/syslog. Then I restart syslog. As a result, syslogd resumes operation.

It turns out that the date of this file is messy!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.