[arch-general] Daemon No Longer Writes To Logs
I was looking at '/var/log/mail.log' which is the default location Postfix MTA writes everything it does to. I was sadly in that file using Vim and deleted the last line. I didn't restore the removed line and simply saved the file. I noticed now that the Postfix daemon no longer writes anything to the log file since I edited it. No permissions have changed at all. It's still in the same location and owned by the same UID/GID. Code: -rw-r----- 1 root log 189 Mar 3 08:37 mail.log I can see that Postfix is however logging everything under '/var/log/everything.log' Anyone know how to fix this? I am worried I broke Postfix but mail is still flowing and I get no errors at all from Postfix. It's just not writing to 'mail.log' any longer.
I was looking at '/var/log/mail.log'
always use less to view log files. vim makes a copy of the files you open, and that could be a lot of unnecesseary IO for big log files.
which is the default location Postfix MTA writes everything it does to. I was sadly in that file using Vim and deleted the last line. I didn't restore the removed line and simply saved the file. I noticed now that the Postfix daemon no longer writes anything to the log file since I edited it.
When vim saves a file it actually saves a new copy of the file. But postfix kept the old file opened and is still writing to it. You can for example compare the inode of the file you see in the filesystem ls -i /var/log/mail.log and the node reported by "lsof -p <THE PID OF POSTFIX HERE>" -- damjan
On Wed, Mar 3, 2010 at 10:03 AM, Damjan Georgievski <gdamjan@gmail.com> wrote:
I was looking at '/var/log/mail.log'
always use less to view log files. vim makes a copy of the files you open, and that could be a lot of unnecesseary IO for big log files.
I wanted to really just clear all my log errors and mess from testing over the night and start fresh. This is really why I opened it in Vim. Just after I removed all the errors from the night before, it no longer wrote to the log file and more once saved.
You can for example compare the inode of the file you see in the filesystem ls -i /var/log/mail.log and the node reported by "lsof -p <THE PID OF POSTFIX HERE>"
Interesting! [root@mail postfix]# ls -i /var/log/mail.log 15828 /var/log/mail.log [root@mail postfix]# ps -ef | grep -i "postfix" root 24030 1 0 08:37 ? 00:00:00 /usr/lib/postfix/master postfix 24298 24030 0 10:06 ? 00:00:00 pickup -l -t fifo -u postfix 24299 24030 0 10:06 ? 00:00:00 qmgr -l -t fifo -u root 24311 24270 0 10:10 pts/1 00:00:00 grep -i postfix [root@mail postfix]# lsof -p 24030 First, which is the correct PID? Is it the 'master' PID? Secondly, I don't appear to have the command in my system for some reason. Perhaps I need to install the utility.
On Wed, Mar 3, 2010 at 9:22 AM, Carlos Williams <carloswill@gmail.com> wrote:
I was looking at '/var/log/mail.log' which is the default location Postfix MTA writes everything it does to. I was sadly in that file using Vim and deleted the last line. I didn't restore the removed line and simply saved the file. I noticed now that the Postfix daemon no longer writes anything to the log file since I edited it. No permissions have changed at all. It's still in the same location and owned by the same UID/GID.
Code:
-rw-r----- 1 root log 189 Mar 3 08:37 mail.log
I can see that Postfix is however logging everything under '/var/log/everything.log'
Anyone know how to fix this? I am worried I broke Postfix but mail is still flowing and I get no errors at all from Postfix. It's just not writing to 'mail.log' any longer.
I don't think Postfix writes its own log files, but uses syslog to do it. You should probably be debugging syslog-ng instead. A simple SIGHUP might fix it.
On Wed, Mar 3, 2010 at 10:22 AM, Ray Kohler <ataraxia937@gmail.com> wrote:
I don't think Postfix writes its own log files, but uses syslog to do it. You should probably be debugging syslog-ng instead. A simple SIGHUP might fix it.
What is 'SIGHUP'? I have never debugged 'Syslog' before. :(
On Wed, Mar 3, 2010 at 10:33 AM, Carlos Williams <carloswill@gmail.com> wrote:
On Wed, Mar 3, 2010 at 10:22 AM, Ray Kohler <ataraxia937@gmail.com> wrote:
I don't think Postfix writes its own log files, but uses syslog to do it. You should probably be debugging syslog-ng instead. A simple SIGHUP might fix it.
What is 'SIGHUP'? I have never debugged 'Syslog' before. :(
The standard Unix "HUP" (hang-up) signal. Most daemons will reload their configs and do other appropriate things if they get such a signal. I suggest you do "pkill -1 syslog-ng" as root and see if stuck logs come out. That's equivalent to what logrotate does after rolling your logs each week, to tell syslog-ng that it changed the files around.
On Wed, Mar 3, 2010 at 10:43 AM, Ray Kohler <ataraxia937@gmail.com> wrote:
The standard Unix "HUP" (hang-up) signal. Most daemons will reload their configs and do other appropriate things if they get such a signal. I suggest you do "pkill -1 syslog-ng" as root and see if stuck logs come out. That's equivalent to what logrotate does after rolling your logs each week, to tell syslog-ng that it changed the files around.
Thanks all. Looks like a reboot simply did the trick. I think that reloaded the 'syslog' daemon or something to that nature. Regardless she is logging!
participants (3)
-
Carlos Williams
-
Damjan Georgievski
-
Ray Kohler