ps -ef |grep sendmail
滿屏ps -ef |grep postdrop
滿屏node
查看log瘋狂刷屏bash
[root@10-10-11-141 runtime]# tail -f /var/log/maillog Nov 12 18:00:24 10-10-11-141 postfix/postdrop[3804]: warning: mail_queue_enter: create file maildrop/634461.3804: No such file or directory Nov 12 18:00:24 10-10-11-141 postfix/postdrop[4147]: warning: mail_queue_enter: create file maildrop/634601.4147: No such file or directory Nov 12 18:00:24 10-10-11-141 postfix/postdrop[1741]: warning: mail_queue_enter: create file maildrop/634604.1741: No such file or directory Nov 12 18:00:24 10-10-11-141 postfix/postdrop[1967]: warning: mail_queue_enter: create file maildrop/843229.1967: No such file or directory Nov 12 18:00:25 10-10-11-141 postfix/postdrop[3244]: warning: mail_queue_enter: create file maildrop/135131.3244: No such file or directory Nov 12 18:00:25 10-10-11-141 postfix/postdrop[2514]: warning: mail_queue_enter: create file maildrop/135247.2514: No such file or directory
同時/var/spool/postfix/maildrop/
文件夾下出現大量簇文件post
使用pstree|grep crond
,結果以下:url
|-crond---125*[crond---sendmail---postdrop]
可見crond守護進程啓動了sendmail,進而啓動了postdrop。查看crond的配置, crontab -e,都沒有發現幾秒就啓動的程序,因此多是sendmail本身一旦郵件發送不成功,就持續從新發送而致使持續啓動postdrop,而postdrop老是執行失敗,致使持續寫入日誌到日誌文件。日誌文件增大的速率超過了logrotate的刪除頻率,因此佔據了100%的磁盤空間。而且線程數也不斷的增長。線程
首先停掉posfix /etc/init.d/posfix stop
並刪除/var/spool/postfix/maildrop/
下面的所有簇文件,釋放磁盤inode!rest
而後就是手起刀落幹掉sendmail和postdrop的進程,注意先幹掉postdrop子進程日誌
kill -9 $(ps -auwx | grep postdrop | gawk -F' ' '{print $2}')
kill -9 $(ps -auwx | grep sendmail | gawk -F' ' '{print $2}')
code
以後還要設置crond的MAILTO爲空進程
[root@10-10-11-141 runtime]# cat /etc/cron.d/0hourly MAILTO="" SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin HOME=/ 01 * * * * root run-parts /etc/cron.hourly
[root@10-10-11-141 runtime]# cat /etc/crontab MAILTO="" SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin HOME=/ # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed [root@10-10-11-141 runtime]# service crond restart
最後整個世界都清靜了!crontab