<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]由于crondtab定时任务导致大量sendmail进程的解决办法]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Mon, 01 Jan 2018 06:49:39 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：Zabbix报警进程数太多报警Too many processes on servername ...。发现是Sendmail进程数太多。<br/>ps -ef&#124;grep sendmail&#124;wc -l<br/>569<br/>-bash: /data/logs/.syshistory/bash_history.log: Read-only file system<br/>/usr/sbin/postdrop -r<br/>/usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root<br/>[aio/21]<br/>[kblockd/18]<br/>[kondemand/0]<br/>[kondemand/1]<br/>[kondemand/N]<br/><br/><br/>执行top的时候发现当前用户下面有很多sendmail的进程，如下图所示，发件人是crondaemon，怀疑是和定时任务有关，查看当前用户的定时任务发现有一个每分钟运行一次的定时任务，但是定时脚本是没有调用sendmail了，ps -ef &#124; grep sendmail &#124; wc -l 统计发现sendmail的进程数据基本上就是从服务器出故障到当前时间的分钟数。<br/><textarea name="code" class="php" rows="15" cols="100">
/usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
/usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
/usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
</textarea><br/><br/>然道是crontab每次执行都会调用sendmail发邮件吗？man 5 crontab查看帮助手册的时候发现这个一段话：<br/>In&nbsp;&nbsp;addition&nbsp;&nbsp;to&nbsp;&nbsp;LOGNAME,&nbsp;&nbsp;HOME,&nbsp;&nbsp;and SHELL, cron(8) will look at MAILTO if it has any reason to send mail as a result of running commands in &quot;this&quot; crontab.&nbsp;&nbsp;If MAILTO is defined (and non-empty), mail is sent to the user so named.&nbsp;&nbsp;If MAILTO is defined but empty (MAILTO=&quot;&quot;), no mail will be sent.&nbsp;&nbsp;Otherwise mail is sent to the owner of the crontab.&nbsp;&nbsp;This option is useful if you decide on /bin/mail instead of /usr/lib/sendmail as your mailer when you install&nbsp;&nbsp;cron&nbsp;&nbsp;-- /bin/mail doesnt do aliasing, and UUCP usually doesnt read its mail. If MAILFROM is defined (and non-empty), it will be used as the envelope sender address, otherwise, ‘‘root’’ will be used.<br/><br/><br/>查看crontab的配置文件：<br/>cat /etc/crontab<br/>SHELL=/bin/bash<br/>PATH=/sbin:/bin:/usr/sbin:/usr/bin<br/>MAILTO=root<br/>HOME=/<br/><br/>可以看到MAILTO这一行不为空，如果不想让它发邮件的话可以按照手册上面说的把MAILTO这一行删掉或者改为MAILTO=&quot;&quot;<br/><br/>From:http://blog.51cto.com/chenql/1878182
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]由于crondtab定时任务导致大量sendmail进程的解决办法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>