Showing results for 
Search instead for 
Did you mean: 


Regular Advisor


How do you restart mail.log?
I moved the old mail.log file with another name
a couple of days ago and I still have 0 in my mail.log. I have restarted sendmail thinking that would do it but not so. Anybody know?
Ross Hanson
James R. Ferguson
Acclaimed Contributor

Re: /var/adm/syslog/mail.log


# /sbin/init.d/sendmail stop
# /sbin/init.d/sendmail start


Jim Walls
Trusted Contributor

Re: /var/adm/syslog/mail.log

You need to tell syslogd to re-initialise:

mv /var/adm/syslog/mail.log /var/adm/syslog/mail.log.1
kill -HUP $(cat /var/run/

Bill Hassell
Honored Contributor

Re: /var/adm/syslog/mail.log

The mv command simply renames the file in the directory, but syslog still has the file open. You have to restart syslogd so it will close the current file and open the new file. However, a better way to do this is to use cp -p and then zero the contents of the current file, like this:

# cp -p mail.log mail.log.old
$ cat /dev/null > mail.log

You can also zero the log with:

# > mail.log

There are two advantages to this method:

1. The mail.log file can remain open and syslogd will continue to log without interruption, and

2. the current mail.log and the copy of the old file will have the correct permissions and ownership.

Bill Hassell, sysadmin