Chinaunix首页 | 论坛 | 博客
  • 博客访问: 609688
  • 博文数量: 139
  • 博客积分: 826
  • 博客等级: 少校
  • 技术积分: 1367
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-25 17:30
文章分类

全部博文(139)

文章存档

2016年(2)

2015年(2)

2014年(1)

2012年(15)

2011年(41)

2007年(33)

2006年(45)

分类: BSD

2011-07-06 22:02:28

完全关闭sendmail不仅需要将/etc/rc.conf中的sendmail_flags=”xxxx”改为sendmail_falgs=NO
由于系统定时任务还会启动它,所以还需作如下修改
修改/etc/daily
找到下面代码
sh /etc/security 2>&1 > $OUT
if [ -s $OUT ]; then
mail -s “$host daily insecurity output” root < $OUT
fi

修改如下

sh /etc/security 2>&1 > $OUT.TMP
if [ -s $OUT.TMP ]; then
echo “$host daily insecurity output” > $OUT
cat $OUT.TMP >> $OUT
rm $OUT.TMP
/usr/libexec/mail.local root > $OUT
fi

修改crontab
#crontab -u root -e

30 1 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | mail - s “`/bin/hostname` daily output” root
30 3 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s “`/bin/hostname` weekly output” root
30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s “`/bin/hostname` monthly output” root

修改为

30 1 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | /usr/libexec/mail.local root
30 3 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | /usr/libexec/mail.local root
30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | /usr/libexec/mail.local root

并注释掉启动Sendmail行
#*/30 * * * * /usr/sbin/sendmail -L sm-msp-queue -Ac -q

阅读(891) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~