加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

crond-sendmail-postdrop导致Linux定期死掉的完整解决过程

(2015-12-25 01:40:27)
标签:

杂谈

分类: LINUX

上次为了解决发送邮件到ROOT用户,而将MAILTO=ROOT改成MAIL_TO="",导致了过一段时间就无法连接到主机,只有重启主机,非常的郁闷,搞了2次后,决定找出原因:

查看/VAR/LOG/MESSAGE:

Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 2985]     2985    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 2986]     2986    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 2987]     2987    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 2988]     2988    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3015]     3015    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3016]     3016    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3017]     3017    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3018]     3018    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3019]     3019    20389      220                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3020]     3020    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3039]     3039    20380      222                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3040]     3040    20380      224                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3041]     3041    20380      223                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3047]     3047    20380      220                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3048]     3048    20380      222                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3058]     3058    20380      223                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3091]     3091    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3092]     3092    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3093]     3093    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3094]     3094    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3095]     3095    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3096]     3096    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3097]     3097    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3098]     3098    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3133]     3133    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3157]     3157    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3158]     3158    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3160]     3160    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3161]     3161    20389      220                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3162]     3162    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3163]     3163    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3168]     3168    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3198]     3198     5073      451                   0 sampler.py
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3199]     3199    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3205]     3205    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3206]     3206    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3207]     3207    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3208]     3208    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3209]     3209    35110      251                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3218]     3218    20380      218                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3219]     3219    20380      220                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3223]     3223    20380      222                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3227]     3227    20380      218                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3230]     3230    20380      223                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3231]     3231    20380      224                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3233]     3233    20380      223                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3273]     3273    27050       42                   0 sh
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3287]     3287    20345      220                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3288]     3288    20345      220                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3289]     3289    20389      219                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3290]     3290    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3291]     3291    20345      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3311]     3311    20389      218                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3321]     3321    35111      256                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3322]     3322    35111      256                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3323]     3323    35045      184                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3324]     3324    35045      184                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3325]     3325    35111      256                   0 crond
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3331]     3331    20380      229                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3334]     3334    42238      113                   0 curl
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3335]     3335    42238      110                   0 curl
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3336]     3336    42238      110                   0 curl
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3337]     3337    42238      110                   0 curl
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3338]     3338    42238      110                   0 curl
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3340]     3340    27080      275                   0 pstree
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3342]     3342    25255       26                   0 egrep
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3344]     3344    26488       34                   0 awk
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3345]     3345    26488       35                   0 awk
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3373]     3373    10320       44                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3374]     3374    11392       45                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3375]     3375    15940       68                   0 postdrop
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3394]    99  3394    22457     2117                   0 nginx
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3399]    99  3399    22457     3173                   0 nginx
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3400]     3400     4499       24                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3402]     3402     5491       26                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3403]     3403     1240       14                   0 sendmail
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: [ 3407]    99  3407    22457     6366                   0 nginx
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: Out of memory: Kill process 3407 (nginx) score 3 or sacrifice child
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: Killed process 3407, UID 99, (nginx) total-vm:89828kB, anon-rss:25444kB, file-rss:20kB
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: postdrop invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: postdrop cpuset=/ mems_allowed=0
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: Pid: 14930, comm: postdrop Not tainted 2.6.32-431.20.3.el6.x86_64 #1
Dec 24 21:47:47 iZ23u6q3k6bZ kernel: Call Trace:

 

发现规律性的出现CRON、SENDMAIL、POSTDROP ,然后内存溢出,NGINX最终无法访问,机器出现假死的情况。

 

继续查看日志:

 tail -n 100 /var/log/maillog
Dec 25 00:50:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/764594.1316: No such file or directory
Dec 25 00:50:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/764754.1316: No such file or directory
Dec 25 00:50:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/764902.1316: No such file or directory
Dec 25 00:50:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/765059.1316: No such file or directory
Dec 25 00:51:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/765234.1316: No such file or directory
Dec 25 00:51:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/765429.1316: No such file or directory
Dec 25 00:51:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/765607.1316: No such file or directory
Dec 25 00:51:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/765776.1316: No such file or directory
Dec 25 00:51:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/765933.1316: No such file or directory
Dec 25 00:51:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/766128.1316: No such file or directory
Dec 25 00:52:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/766299.1316: No such file or directory
Dec 25 00:52:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/766470.1316: No such file or directory
Dec 25 00:52:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/766624.1316: No such file or directory
Dec 25 00:52:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/766790.1316: No such file or directory
Dec 25 00:52:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/766958.1316: No such file or directory
Dec 25 00:52:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/767136.1316: No such file or directory
Dec 25 00:53:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/767312.1316: No such file or directory
Dec 25 00:53:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/767480.1316: No such file or directory
Dec 25 00:53:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/767645.1316: No such file or directory
Dec 25 00:53:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/767762.1316: No such file or directory
Dec 25 00:53:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/767927.1316: No such file or directory
Dec 25 00:53:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/768102.1316: No such file or directory
Dec 25 00:54:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/768304.1316: No such file or directory
Dec 25 00:54:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/768471.1316: No such file or directory
Dec 25 00:54:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/768625.1316: No such file or directory
Dec 25 00:54:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/768762.1316: No such file or directory
Dec 25 00:54:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/768940.1316: No such file or directory
Dec 25 00:54:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/769071.1316: No such file or directory
Dec 25 00:55:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/769254.1316: No such file or directory
Dec 25 00:55:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/769424.1316: No such file or directory
Dec 25 00:55:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/769580.1316: No such file or directory
Dec 25 00:55:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/769765.1316: No such file or directory
Dec 25 00:55:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/769928.1316: No such file or directory
Dec 25 00:55:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/770099.1316: No such file or directory
Dec 25 00:56:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/770239.1316: No such file or directory
Dec 25 00:56:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/770406.1316: No such file or directory
Dec 25 00:56:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/770574.1316: No such file or directory
Dec 25 00:56:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/770727.1316: No such file or directory
Dec 25 00:56:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/770909.1316: No such file or directory
Dec 25 00:56:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/771071.1316: No such file or directory
Dec 25 00:57:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/771267.1316: No such file or directory
Dec 25 00:57:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/771445.1316: No such file or directory
Dec 25 00:57:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/771599.1316: No such file or directory
Dec 25 00:57:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/771749.1316: No such file or directory
Dec 25 00:57:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/771928.1316: No such file or directory
Dec 25 00:57:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/772086.1316: No such file or directory
Dec 25 00:58:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/772268.1316: No such file or directory
Dec 25 00:58:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/772443.1316: No such file or directory
Dec 25 00:58:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/772599.1316: No such file or directory
Dec 25 00:58:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/772755.1316: No such file or directory
Dec 25 00:58:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/772956.1316: No such file or directory
Dec 25 00:58:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/773111.1316: No such file or directory
Dec 25 00:59:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/773279.1316: No such file or directory
Dec 25 00:59:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/773453.1316: No such file or directory
Dec 25 00:59:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/773607.1316: No such file or directory
Dec 25 00:59:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/773796.1316: No such file or directory
Dec 25 00:59:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/773949.1316: No such file or directory
Dec 25 00:59:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/774094.1316: No such file or directory
Dec 25 01:00:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/774250.1316: No such file or directory
Dec 25 01:00:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/774424.1316: No such file or directory
Dec 25 01:00:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/774626.1316: No such file or directory
Dec 25 01:00:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/774762.1316: No such file or directory
Dec 25 01:00:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/774917.1316: No such file or directory
Dec 25 01:00:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/775081.1316: No such file or directory
Dec 25 01:01:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/775254.1316: No such file or directory
Dec 25 01:01:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/775445.1316: No such file or directory
Dec 25 01:01:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/775624.1316: No such file or directory
Dec 25 01:01:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/775801.1316: No such file or directory
Dec 25 01:01:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/776016.1316: No such file or directory
Dec 25 01:01:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/776184.1316: No such file or directory
Dec 25 01:02:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/776365.1316: No such file or directory
Dec 25 01:02:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/776521.1316: No such file or directory
Dec 25 01:02:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/776703.1316: No such file or directory
Dec 25 01:02:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/776900.1316: No such file or directory
Dec 25 01:02:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/777069.1316: No such file or directory
Dec 25 01:02:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/777224.1316: No such file or directory
Dec 25 01:03:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/777379.1316: No such file or directory
Dec 25 01:03:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/777563.1316: No such file or directory
Dec 25 01:03:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/777758.1316: No such file or directory
Dec 25 01:03:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/777984.1316: No such file or directory
Dec 25 01:03:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/778174.1316: No such file or directory
Dec 25 01:03:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/778330.1316: No such file or directory
Dec 25 01:04:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/778512.1316: No such file or directory
Dec 25 01:04:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/778694.1316: No such file or directory
Dec 25 01:04:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/778881.1316: No such file or directory
Dec 25 01:04:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/779044.1316: No such file or directory
Dec 25 01:04:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/779190.1316: No such file or directory
Dec 25 01:04:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/779373.1316: No such file or directory
Dec 25 01:05:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/779567.1316: No such file or directory
Dec 25 01:05:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/779727.1316: No such file or directory
Dec 25 01:05:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/779922.1316: No such file or directory
Dec 25 01:05:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/780060.1316: No such file or directory
Dec 25 01:05:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/780225.1316: No such file or directory
Dec 25 01:05:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/780395.1316: No such file or directory
Dec 25 01:06:06 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/780550.1316: No such file or directory
Dec 25 01:06:16 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/780708.1316: No such file or directory
Dec 25 01:06:26 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/780866.1316: No such file or directory
Dec 25 01:06:36 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/781033.1316: No such file or directory
Dec 25 01:06:46 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/781177.1316: No such file or directory
Dec 25 01:06:56 iZ23u6q3k6bZ postfix/postdrop[1316]: warning: mail_queue_enter: create file maildrop/781351.1316: No such file or directory
[root@iZ23u6q3k6bZ ~]# ps -ef | grep sendmail

 

查看SENDMAIL 和POSTDROP 进程:
ps -ef | grep sendmail
root      1302  1276  0 Dec24 ?        00:00:00 sh -c printf %b "Subject: [Fail2Ban] SSH: started on `uname -n`?Date: `LC_TIME=C date -u +"%a, %d %h %Y %T +0000"`?From: Fail2Ban <<A href="mailto:fail2ban@example.com>?To">fail2ban@example.com>?To: you@example.com\n?Hi,\n?The jail SSH has been started successfully.\n?Regards,\n?Fail2Ban" | /usr/sbin/sendmail -f fail2ban@example.com you@example.com
root      1304  1302  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -f fail2ban@example.com you@example.com
root      1383  1363  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1384  1366  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1385  1364  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1386  1367  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1387  1365  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1464  1443  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1467  1438  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1468  1439  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1469  1441  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1471  1442  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1472  1444  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1478  1440  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1585  1565  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1586  1562  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1587  1564  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1588  1563  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1596  1566  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1603  1561  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1649  1631  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1654  1634  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1655  1633  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1656  1632  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1662  1635  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1675  1630  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1716  1702  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1721  1705  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1723  1701  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1724  1703  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1730  1704  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1790  1769  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1792  1774  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1796  1768  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1797  1770  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1798  1773  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1820  1775  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1824  1771  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1829  1772  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1879  1862  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1880  1858  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1881  1859  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1884  1863  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1894  1860  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1895  1861  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1946  1928  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1948  1929  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1949  1931  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1952  1932  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1957  1927  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      1969  1930  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2033  2015  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2034  2016  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2037  2017  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2038  2018  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2039  2013  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2046  2014  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2111  2096  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2115  2095  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2118  2100  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2119  2099  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2123  2097  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2133  2098  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2219  2203  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2220  2202  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2221  2204  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2228  2205  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2240  2201  0 Dec24 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2307  2282  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2308  2287  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2314  2283  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2317  2285  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2320  2284  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2327  2288  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2328  2289  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2335  2286  0 00:00 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2404  2392  0 00:01 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2411  2389  0 00:01 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2412  2390  0 00:01 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2418  2391  0 00:01 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2430  2394  0 00:01 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2443  2393  0 00:01 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2508  2491  0 00:02 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2509  2489  0 00:02 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2510  2488  0 00:02 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2521  2492  0 00:02 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2526  2490  0 00:02 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2582  2564  0 00:03 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2583  2565  0 00:03 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2586  2568  0 00:03 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2600  2567  0 00:03 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2601  2566  0 00:03 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2658  2642  0 00:04 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2662  2641  0 00:04 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2667  2644  0 00:04 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2668  2643  0 00:04 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2674  2640  0 00:04 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2737  2717  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2739  2723  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2744  2721  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2746  2720  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2749  2718  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2750  2719  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2768  2722  0 00:05 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2831  2814  0 00:06 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2833  2815  0 00:06 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2839  2816  0 00:06 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2841  2817  0 00:06 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2848  2818  0 00:06 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2902  2893  0 00:07 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2904  2891  0 00:07 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2911  2890  0 00:07 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2915  2889  0 00:07 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2916  2892  0 00:07 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2981  2966  0 00:08 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2982  2968  0 00:08 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      2983  2969  0 00:08 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3001  2967  0 00:08 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3006  2965  0 00:08 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3062  3042  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3063  3044  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3064  3040  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3070  3045  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3071  3041  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3082  3043  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3084  3046  0 00:09 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3160  3141  0 00:10 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3164  3142  0 00:10 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3165  3144  0 00:10 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3166  3140  0 00:10 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3167  3143  0 00:10 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3191  3145  0 00:10 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3261  3244  0 00:11 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3262  3245  0 00:11 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3265  3247  0 00:11 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3268  3246  0 00:11 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3277  3248  0 00:11 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3343  3323  0 00:12 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3344  3325  0 00:12 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3345  3324  0 00:12 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3346  3326  0 00:12 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3361  3327  0 00:12 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3416  3401  0 00:13 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3419  3404  0 00:13 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3424  3400  0 00:13 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3425  3403  0 00:13 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3432  3402  0 00:13 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3489  3477  0 00:14 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3495  3480  0 00:14 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3496  3476  0 00:14 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3508  3479  0 00:14 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3511  3478  0 00:14 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3573  3553  0 00:15 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3574  3556  0 00:15 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3575  3558  0 00:15 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3576  3557  0 00:15 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3588  3554  0 00:15 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3589  3555  0 00:15 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3653  3640  0 00:16 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3657  3642  0 00:16 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3658  3641  0 00:16 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3665  3638  0 00:16 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3673  3639  0 00:16 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3730  3715  0 00:17 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3731  3714  0 00:17 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3738  3717  0 00:17 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3739  3718  0 00:17 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3745  3716  0 00:17 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3812  3794  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3815  3793  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3817  3792  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3822  3796  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3827  3795  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3828  3798  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3841  3797  0 00:18 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3905  3887  0 00:19 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3906  3889  0 00:19 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3907  3890  0 00:19 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3909  3888  0 00:19 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3925  3891  0 00:19 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3987  3969  0 00:20 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3988  3967  0 00:20 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3989  3964  0 00:20 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      3990  3968  0 00:20 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4008  3966  0 00:20 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4014  3965  0 00:20 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4072  4058  0 00:21 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4073  4056  0 00:21 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4074  4057  0 00:21 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4076  4054  0 00:21 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      4088  4055  0 00:21 ?        00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
root      5118  3212  0 00:39 pts/2    00:00:00 grep sendmail


[root@iZ23u6q3k6bZ ~]# ps -ef | grep postdrop
root      1323  1304  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1394  1384  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1396  1385  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1397  1383  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1401  1386  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1403  1387  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1479  1469  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1485  1468  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1489  1467  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1492  1471  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1493  1464  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1495  1472  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1496  1478  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1595  1586  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1597  1588  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1602  1596  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1604  1587  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1607  1585  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1618  1603  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1663  1649  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1664  1655  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1669  1656  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1673  1654  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1679  1662  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1687  1675  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1731  1723  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1732  1716  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1740  1724  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1742  1730  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1750  1721  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1801  1790  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1810  1792  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1816  1796  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1818  1798  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1833  1824  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1835  1797  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1842  1820  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1843  1829  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1896  1884  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1897  1879  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1900  1881  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1901  1880  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1907  1895  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1913  1894  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1958  1946  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1959  1949  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1968  1948  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1978  1952  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1979  1969  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      1980  1957  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2047  2034  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2052  2037  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2054  2038  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2057  2039  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2065  2046  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2066  2033  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2132  2115  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2134  2118  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2135  2123  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2136  2111  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2149  2133  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2150  2119  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2229  2220  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2230  2219  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2239  2228  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2243  2240  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2246  2221  0 Dec24 ?        00:00:00 /usr/sbin/postdrop -r
root      2322  2308  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2324  2317  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2341  2327  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2342  2328  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2346  2320  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2348  2307  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2349  2314  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2354  2335  0 00:00 ?        00:00:00 /usr/sbin/postdrop -r
root      2421  2404  0 00:01 ?        00:00:00 /usr/sbin/postdrop -r
root      2431  2412  0 00:01 ?        00:00:00 /usr/sbin/postdrop -r
root      2432  2411  0 00:01 ?        00:00:00 /usr/sbin/postdrop -r
root      2433  2418  0 00:01 ?        00:00:00 /usr/sbin/postdrop -r
root      2442  2430  0 00:01 ?        00:00:00 /usr/sbin/postdrop -r
root      2448  2443  0 00:01 ?        00:00:00 /usr/sbin/postdrop -r
root      2515  2510  0 00:02 ?        00:00:00 /usr/sbin/postdrop -r
root      2518  2508  0 00:02 ?        00:00:00 /usr/sbin/postdrop -r
root      2522  2509  0 00:02 ?        00:00:00 /usr/sbin/postdrop -r
root      2525  2521  0 00:02 ?        00:00:00 /usr/sbin/postdrop -r
root      2534  2526  0 00:02 ?        00:00:00 /usr/sbin/postdrop -r
root      2587  2583  0 00:03 ?        00:00:00 /usr/sbin/postdrop -r
root      2590  2582  0 00:03 ?        00:00:00 /usr/sbin/postdrop -r
root      2598  2586  0 00:03 ?        00:00:00 /usr/sbin/postdrop -r
root      2608  2600  0 00:03 ?        00:00:00 /usr/sbin/postdrop -r
root      2609  2601  0 00:03 ?        00:00:00 /usr/sbin/postdrop -r
root      2661  2658  0 00:04 ?        00:00:00 /usr/sbin/postdrop -r
root      2671  2662  0 00:04 ?        00:00:00 /usr/sbin/postdrop -r
root      2678  2667  0 00:04 ?        00:00:00 /usr/sbin/postdrop -r
root      2680  2668  0 00:04 ?        00:00:00 /usr/sbin/postdrop -r
root      2685  2674  0 00:04 ?        00:00:00 /usr/sbin/postdrop -r
root      2758  2737  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2760  2744  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2763  2739  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2765  2746  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2767  2749  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2775  2750  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2782  2768  0 00:05 ?        00:00:00 /usr/sbin/postdrop -r
root      2842  2831  0 00:06 ?        00:00:00 /usr/sbin/postdrop -r
root      2843  2833  0 00:06 ?        00:00:00 /usr/sbin/postdrop -r
root      2850  2841  0 00:06 ?        00:00:00 /usr/sbin/postdrop -r
root      2854  2839  0 00:06 ?        00:00:00 /usr/sbin/postdrop -r
root      2861  2848  0 00:06 ?        00:00:00 /usr/sbin/postdrop -r
root      2918  2904  0 00:07 ?        00:00:00 /usr/sbin/postdrop -r
root      2920  2911  0 00:07 ?        00:00:00 /usr/sbin/postdrop -r
root      2927  2916  0 00:07 ?        00:00:00 /usr/sbin/postdrop -r
root      2929  2915  0 00:07 ?        00:00:00 /usr/sbin/postdrop -r
root      2936  2902  0 00:07 ?        00:00:00 /usr/sbin/postdrop -r
root      2989  2983  0 00:08 ?        00:00:00 /usr/sbin/postdrop -r
root      2991  2981  0 00:08 ?        00:00:00 /usr/sbin/postdrop -r
root      2992  2982  0 00:08 ?        00:00:00 /usr/sbin/postdrop -r
root      3007  3001  0 00:08 ?        00:00:00 /usr/sbin/postdrop -r
root      3011  3006  0 00:08 ?        00:00:00 /usr/sbin/postdrop -r
root      3076  3062  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3083  3063  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3086  3071  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3095  3084  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3096  3070  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3098  3082  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3100  3064  0 00:09 ?        00:00:00 /usr/sbin/postdrop -r
root      3172  3164  0 00:10 ?        00:00:00 /usr/sbin/postdrop -r
root      3174  3165  0 00:10 ?        00:00:00 /usr/sbin/postdrop -r
root      3178  3166  0 00:10 ?        00:00:00 /usr/sbin/postdrop -r
root      3187  3167  0 00:10 ?        00:00:00 /usr/sbin/postdrop -r
root      3189  3160  0 00:10 ?        00:00:00 /usr/sbin/postdrop -r
root      3196  3191  0 00:10 ?        00:00:00 /usr/sbin/postdrop -r
root      3275  3268  0 00:11 ?        00:00:00 /usr/sbin/postdrop -r
root      3278  3265  0 00:11 ?        00:00:00 /usr/sbin/postdrop -r
root      3279  3262  0 00:11 ?        00:00:00 /usr/sbin/postdrop -r
root      3284  3261  0 00:11 ?        00:00:00 /usr/sbin/postdrop -r
root      3285  3277  0 00:11 ?        00:00:00 /usr/sbin/postdrop -r
root      3353  3344  0 00:12 ?        00:00:00 /usr/sbin/postdrop -r
root      3355  3346  0 00:12 ?        00:00:00 /usr/sbin/postdrop -r
root      3362  3343  0 00:12 ?        00:00:00 /usr/sbin/postdrop -r
root      3363  3345  0 00:12 ?        00:00:00 /usr/sbin/postdrop -r
root      3369  3361  0 00:12 ?        00:00:00 /usr/sbin/postdrop -r
root      3426  3416  0 00:13 ?        00:00:00 /usr/sbin/postdrop -r
root      3434  3424  0 00:13 ?        00:00:00 /usr/sbin/postdrop -r
root      3435  3419  0 00:13 ?        00:00:00 /usr/sbin/postdrop -r
root      3436  3425  0 00:13 ?        00:00:00 /usr/sbin/postdrop -r
root      3447  3432  0 00:13 ?        00:00:00 /usr/sbin/postdrop -r
root      3501  3489  0 00:14 ?        00:00:00 /usr/sbin/postdrop -r
root      3509  3495  0 00:14 ?        00:00:00 /usr/sbin/postdrop -r
root      3510  3496  0 00:14 ?        00:00:00 /usr/sbin/postdrop -r
root      3520  3508  0 00:14 ?        00:00:00 /usr/sbin/postdrop -r
root      3521  3511  0 00:14 ?        00:00:00 /usr/sbin/postdrop -r

 

进程太多了。http://www/uc/myshow/blog/misc/gif/E___7398ZH00SIGG.gif

 

排错过程

maillog日志文件占满分区空间

照例查看系统日志,/var/log/message、/var/log/secure、dmesg等,没有发现异常。df -h发现日志所在的文件系统分区使用率100%了,是不是因为这个原因系统死掉呢?如如何根据日志判断呢?(ToDo)。
记得之前有一次因为这个分区占用较大,一气之下把/var/log整个目录都rm -rf了,导致了一些关键的目录和文件被删除,如/var/log/rflogview/以及其下面的文件,这些是系统日志文件,文件不存在了,rsyslogd也就无法写入(rsyslogd不会自动创建不存在的日志文件),所以一些关键的系统日志都被丢失了。

du -sh 查看找到了一个巨大的文件/var/log/mailog。head、tail查看内容,发现全是同样的内容行,如下:
May 13 15:29:23 lcha2 postfix/postdrop[1443]: warning: mail_queue_enter: create file maildrop/383480.1443: No such file or directory
May 13 15:29:23 lcha2 postfix/postdrop[1269]: warning: mail_queue_enter: create file maildrop/330426.1269: No such file or directory
May 13 15:29:23 lcha2 postfix/postdrop[1439]: warning: mail_queue_enter: create file maildrop/357169.1439: No such file or directory
May 13 15:29:23 lcha2 postfix/postdrop[1654]: warning: mail_queue_enter: create file maildrop/984222.1654: No such file or directory
使用 tail -f /var/log/maillog,发现每秒都有几乎相同的文本行输出。按照上面的日志内容,判定是postfix这个套件的postdrop程序发出的日志。是谁启动了postdrop呢?
使用pstree,结果如下:

init-+-aacraid
     |-atd
     |-bdflush
     |-crond---125*[crond---sendmail---postdrop]

 

可见crond守护进程启动了sendmail,进而启动了postdrop。查看crond的配置, crontab -e,都没有发现几秒就启动的程序,所以可能是sendmail自己一旦邮件发送不成功,就持续重新发送而导致持续启动postdrop,而postdrop总是执行失败,导致持续写入日志到日志文件。日志文件增大的速率超过了logrotate的删除频率,所以占据了100%的磁盘空间。


由于sendmail没有退出,导致启动它的crond也不能退出,从而导致多个crond进程并存。

找到了问题,解决起来相对简单。一种方式就是不让postdrop产生的日志写入日志文件,这通过修改/etc/rsyslog.conf文件达成;第二种方式是增大logrotate的删除频率,这通过修改logrotate的crond像以及/etc/logrotate.conf配置文件达成;第三就是找到postdrop失败的原因,修正使其能够成功进行。最简单的就是第一种了,也能满足目前的需要,所以就采取了第一种方式。

修改rsyslog.conf使得不记录mail的warning信息,修改前如下:
mail.*                                                        /var/log/maillog
修改后
mail.err  /var/log/maillog
这样就通过提高日志记录的级别来舍弃了mail类的warning级别日志。

service rsyslog restart重新启动syslogd。然后tail -f /var/log/maillog,在没有上面类似日志的输出了。
 

文件打开数量达到极限

然而,几天后重新出现死机的现象,不过这次在现场显示器上看到了类似 "cannot open shared object file: Too many open files in system"的信息。在Linux中,“一切都是文件”,程序文件本身、各种库文件、管道、设备、网络连接等等都是文件。上述信息说明,系统打开的文件数量到达了极限,从而导致无法打开新文件,当然也就无法执行程序。通过 sysctl -a 可以看到fs.file-max = 131072,这个数字也不小了。那么是谁打开了这么多的文件呢?通过lsof 查看发现名为sendmail和postdrop的多个进程,每个进程都打开了多个文件。通过 ps -e | grep sendmail | cut -d ' ' -f2 | xargs kill,以及ps -e | grep postdrop| cut -d ' ' -f2 | xargs kill,杀死所有sendmail和postdrop进程后,再lsof发现打开的文件数骤减。

前面已经给出了pstree的结果,发现是cron启动了sendmail,sendmail启动了postdrop。临时写了一个小的测试脚本,来看sendmai的启动频率。
 
while true
do
        date +%H:%M:%S >> 1.txt
        ps -e | grep sendmail | wc >>1.txt
        sleep 5
done
 
从结果文件1.txt中发现每10分钟,就会启动一个sendmail进程。crontab里有个没有这个频率的启动项,但有一个每5分钟自动网络校时的启动项。把这个项注视掉,重新启动crond,发现仍然有sendmail的启动,从而排除了这个原因。难道是crond本身每10分钟就自动发送邮件吗?按照man 5 crontab的解释,把/etc/crontab的MAILTO设为"",这样crond就不会发送邮件了。重新启动crond服务,发现crond仍然10分钟启动一次sendmail,太奇怪了!干脆直接关闭crond服务,然后再也没有新的sendmail进程产生。难道是crontab被黑了?为什么MAILTO=""了,还会调用sendmail呢?把所有的sendmail进程都kill掉,然后启动crond,仍然会生产sendmail,看来crond和sendmail的关系绝非一般。

被忽略的/etc/cron.d

弄了半天,发现了/etc/cron.d目录下存在一个文件,而crond会自动读取其中的配置信息,正好这个文件里有一个项就是每10分钟执行一次systat软件包的命令,测试表明这个命令由于所写日志文件不存在而导致报错,一旦报错,crond就会sendemail(不管MAILTO的值如何?)。在这条命令后面加上 &>/dev/null后,发现crond不再启动sendmail进程。

原来内容:
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1 
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A 

其中的命令会报错:
[root@lcha2 root]# /usr/lib/sa/sa1 1 1 
Cannot open /var/log/sa/sa20: No such file or directory

修改后:
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1 &>/dev/null
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A &>/dev/null

全过程总结

http://s16/mw690/0027ipZugy6Y2ba5V7h3f&690

心得体会

  • 日志文件是系统分析的关键,要确保所有日志文件目录可用,如果不可用,syslogd不会自动创建它们,也就失去了记录日志的机会!
  • crond,logrotate,syslogd相互配合
  • crond和sendmail的关系绝非一般,crontab中MAILTO设置了空,crond仍然会调用sendmail发送邮件,解决方式是把crond执行的命令最后加上 &> /dev/null。
  • 要全面了解一个软件包,比如cron.d是crond的一部分,作者就就吃亏在这个上面
  • 多动手测试,熟练使用bash命令

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有