Technical article 127244

How can I reduce or eliminate sendmail entries from my syslog and messages log files.

OpenServer 6.0.0

Written · Last revised

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.log

This 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=0
c)  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/messages
LOG=/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_messages
3) 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

From the Xinuos technical article database, record 127244. Reproduced with permission. The original is at www.sco.com/ta/127244, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.