Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

mail.log

SOLVED
Go to solution
David Crowe
Advisor

mail.log

Is there a way to create a new mail.log file? Ours has grown to the point where it is too large to open with vi. I tried copying it to a new file and then deleting the old one but when I stopped and started sendmail a new one was not created. I also tried creating a new file with the same name but it didn't appear that sendmail was writing to the log.
10 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: mail.log

David:

The proper way to nullify an inuse file is this:

# cat /dev/null > /var/adm/syslog/mail.log

You can do this while the sendmail daemon is running.

...JRF...
Vincenzo Restuccia
Honored Contributor

Re: mail.log

# > /var/adm/syslog/mail.log
or
#touch /var/adm/syslog/mail.log
David Crowe
Advisor

Re: mail.log

Does this just stop logging to the mail.log or does it create a new mail.log?
Vincenzo Restuccia
Honored Contributor
Solution

Re: mail.log

No stop logging to the mail.log,you can create a new mail.log.
Pedro Sousa
Honored Contributor

Re: mail.log

Nope, it does not stop logging to mail.log, but it cleans what you had inside the file until that point in time.
David Crowe
Advisor

Re: mail.log

Mail transactions are no longer being put into my mail.log file. Is there a simple way to correct this?
James R. Ferguson
Acclaimed Contributor

Re: mail.log

Hi David:

If you removed /var/adm/syslog/mail.log instead of redirecting /dev/null to it, then restart sendmail:

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

...JRF...
Jim Moffitt_1
Valued Contributor

Re: mail.log

You could stop and start sendmail:
/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

and also give your syslog daemon a restart:

kill -HUP `cat /var/run/syslog.pid`

Hope that helps.

Jim
David Crowe
Advisor

Re: mail.log

I have already tried stopping and starting sendmail but it did not fix the problem. I will try stopping the syslog daemon and see if that does the trick.

Re: mail.log

Hi,
Logging in /var/adm/syslog/mail.log is manipulated from SYSLOG daemon.
Would you try with:
1. mv /var/adm/syslog/mail.log /var/adm/syslog/mail.log.old
2. touch /var/adm/syslog/mail.log (may be a chmod command will be good)
3. kill -HUP `cat /var/run/syslog.pid`