Problem
How can I reduce or eliminate sendmail entries from my
syslog and/or messages log files. I've tried to set my
sendmail LogLevel to zero and I've tried to redirect my
mail logging in syslog.conf to another file, but sendmail
entries continue to fill my /var/adm/messages file. Solution
This issue has been reported to SCO Engineering.
To work around this problem you can take some or all of these steps.
a) Redirect mail from /var/adm/syslog to another file.
Update /etc/syslog.conf with the following entry:mail.* /usr/adm/mail.logThis will cause the logging that was going into the /var/adm/syslog file to stop and instead go into the file /usr/adm/mail.log.
b) Reduce the amount of log info by setting the sendmail logging level to zero.
1) Edit the file /etc/mail/cf/m4/cfhead.m4, modify the entry for LOG_LEVEL, changing the value to 0, so the entry looks like this:
define(`confLOG_LEVEL', `0')2) Rebuild the sendmail configuration file and restart sendmail using:
# mkdev cf(choose option 7. Generate sendmail.cf file)Hit return and answer 'n' to the question: Do you wish to change anything (y/n)?
Hitting return again will restart sendmail with the new configuration.
(choose option 8. Quit)Verify that the LogLevel is now zero using:
# grep -i LogLevel /etc/mail/sendmail.cf
O LogLevel=0c) Use a root cronjob script to periodically clear the sendmail
entries from /var/adm/messages.Please note:
Even with the LogLevel set to zero and the syslog mail
logging redirected to another file, there is a bug which
continues logging to /var/adm/messages. One way around
this bug is to use this method or something similar.1) Create a script called /usr/bin/trim_messages which looks like this:
---- cut here----
#!/bin/sh# this script will trim sendmail entries from
# /var/adm/messagesLOG=/var/adm/messages
grep -v sendmail $LOG > $LOG.tmp
cp $LOG.tmp $LOG
rm $LOG.tmp
---- cut here----2) Set permissions for the script so only root can execute it:
# chmod 700 /usr/bin/trim_messages
# chown root:sys /usr/bin/trim_messages3) Add a cronjob for root to execute this new script once a
month, using the command `crontab -e` to add this line:0 0 1 * * /usr/bin/trim_messages See also
sendmail(ADMN), crontab(C), syslogd(ADM)
http://osr600doc.xinuos.com/en/MM_sendmail/sndmlN.sendmail_administration.html#sndmlT.running_mkdev_cf