我跑过去Linux BeagleBoard-xM 3.12.5-armv7-x10 #1 SMP Fri Dec 13 03:06:20 UTC 2013 armv7l armv7l armv7l GNU/Linux
,我的手机里/var/log/syslog
就被这样的信息淹没了Jan 11 10:21:09 BeagleBoard-xM sm-msp-queue[8036]: s0AJ66SY002027: to=root, ctladdr=root (0/0), delay=14:15:03, xdelay=00:00:00, mailer=relay, pri=2011764, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
。
当我关闭 sendmailapt-get remove sendmail
并重新启动时,我感到非常惊讶。我检查了进程以确保 sendmail 确实不是跑步:
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
4 0 1 0 20 0 2996 1936 poll_s Ss ? 0:08 /sbin/init
1 0 2 0 20 0 0 0 kthrea S ? 0:00 [kthreadd]
1 0 3 2 20 0 0 0 smpboo S ? 0:00 [ksoftirqd/0]
1 0 4 2 20 0 0 0 worker S ? 0:00 [kworker/0:0]
1 0 5 2 0 -20 0 0 worker S< ? 0:00 [kworker/0:0H]
1 0 6 2 20 0 0 0 worker S ? 0:00 [kworker/u2:0]
1 0 7 2 -100 - 0 0 smpboo S ? 0:00 [migration/0]
1 0 8 2 20 0 0 0 rcu_gp S ? 0:00 [rcu_bh]
1 0 9 2 20 0 0 0 rcu_gp S ? 0:01 [rcu_sched]
1 0 10 2 0 -20 0 0 rescue S< ? 0:00 [khelper]
5 0 11 2 20 0 0 0 devtmp S ? 0:00 [kdevtmpfs]
1 0 12 2 0 -20 0 0 rescue S< ? 0:00 [netns]
1 0 13 2 0 -20 0 0 rescue S< ? 0:00 [writeback]
1 0 15 2 0 -20 0 0 rescue S< ? 0:00 [kintegrityd]
1 0 16 2 0 -20 0 0 rescue S< ? 0:00 [bioset]
1 0 17 2 0 -20 0 0 rescue S< ? 0:00 [kblockd]
1 0 18 2 0 -20 0 0 rescue S< ? 0:00 [ata_sff]
1 0 19 2 20 0 0 0 hub_th S ? 0:00 [khubd]
1 0 20 2 -51 - 0 0 irq_th S ? 0:00 [irq/72-i2c.10]
1 0 21 2 20 0 0 0 worker S ? 0:00 [kworker/u2:1]
1 0 24 2 -51 - 0 0 irq_th S ? 0:00 [irq/73-i2c.11]
1 0 25 2 -51 - 0 0 irq_th S ? 0:00 [irq/77-i2c.12]
1 0 28 2 0 -20 0 0 rescue S< ? 0:00 [edac-poller]
1 0 29 2 0 -20 0 0 rescue S< ? 0:00 [devfreq_wq]
1 0 30 2 0 -20 0 0 rescue S< ? 0:00 [rpciod]
1 0 31 2 20 0 0 0 watchd S ? 0:00 [khungtaskd]
1 0 32 2 20 0 0 0 kswapd S ? 0:00 [kswapd0]
1 0 33 2 20 0 0 0 fsnoti S ? 0:00 [fsnotify_mark]
1 0 34 2 0 -20 0 0 rescue S< ? 0:00 [nfsiod]
1 0 35 2 0 -20 0 0 rescue S< ? 0:00 [bioset]
1 0 36 2 0 -20 0 0 rescue S< ? 0:00 [crypto]
1 0 47 2 0 -20 0 0 rescue S< ? 0:00 [kthrotld]
1 0 48 2 0 -20 0 0 rescue S< ? 0:00 [OMAP UART0]
1 0 49 2 0 -20 0 0 rescue S< ? 0:00 [OMAP UART1]
1 0 50 2 0 -20 0 0 rescue S< ? 0:00 [OMAP UART2]
1 0 51 2 0 -20 0 0 rescue S< ? 0:00 [OMAP UART3]
1 0 52 2 -51 - 0 0 irq_th S ? 0:00 [irq/23-TWL4030-]
1 0 53 2 20 0 0 0 kthrea S ? 0:00 [spi1]
1 0 54 2 20 0 0 0 kthrea S ? 0:00 [spi2]
1 0 55 2 20 0 0 0 kthrea S ? 0:00 [spi3]
1 0 56 2 20 0 0 0 kthrea S ? 0:00 [spi4]
1 0 57 2 0 -20 0 0 rescue S< ? 0:00 [binder]
1 0 58 2 20 0 0 0 mmc_qu S ? 0:01 [mmcqd/0]
1 0 59 2 0 -20 0 0 rescue S< ? 0:00 [deferwq]
1 0 102 2 0 -20 0 0 worker S< ? 0:00 [kworker/0:1H]
1 0 116 2 20 0 0 0 kjourn S ? 0:00 [jbd2/mmcblk0p2-]
1 0 117 2 0 -20 0 0 rescue S< ? 0:00 [ext4-rsv-conver]
1 0 267 1 20 0 2480 1172 poll_s S ? 0:02 upstart-udev-bridge --daemon
5 0 272 1 20 0 9932 1504 SyS_ep Ss ? 0:00 /lib/systemd/systemd-udevd --daemon
5 102 327 1 20 0 3112 1256 SyS_ep Ss ? 0:01 dbus-daemon --system --fork
5 0 342 1 20 0 3224 1256 poll_s Ss ? 0:00 /usr/sbin/bluetoothd
4 0 348 1 20 0 3052 1288 SyS_ep Ss ? 0:00 /lib/systemd/systemd-logind
5 0 359 2 10 -10 0 0 rfcomm S< ? 0:00 [krfcommd]
5 101 361 1 20 0 29332 1164 poll_s Sl ? 0:00 rsyslogd -c5
5 104 368 1 20 0 2692 1128 poll_s S ? 0:00 avahi-daemon: running [BeagleBoard-xM.local]
1 104 369 368 20 0 2692 356 unix_s S ? 0:00 avahi-daemon: chroot helper
4 0 386 1 20 0 6428 2432 SyS_ep Ss ? 0:00 /usr/sbin/cupsd -F
4 0 405 1 20 0 6704 2264 poll_s Ss ? 0:00 /usr/sbin/cups-browsed
4 0 548 1 20 0 3368 712 n_tty_ Ss+ tty4 0:00 /sbin/getty -8 38400 tty4
4 0 550 1 20 0 3368 712 n_tty_ Ss+ tty5 0:00 /sbin/getty -8 38400 tty5
4 0 560 1 20 0 3368 712 n_tty_ Ss+ tty2 0:00 /sbin/getty -8 38400 tty2
4 0 562 1 20 0 3368 712 n_tty_ Ss+ tty3 0:00 /sbin/getty -8 38400 tty3
4 0 568 1 20 0 3368 712 n_tty_ Ss+ tty6 0:00 /sbin/getty -8 38400 tty6
4 0 621 1 20 0 24992 2400 poll_s Ssl ? 0:00 gdm
1 0 622 1 20 0 2324 824 hrtime Ss ? 0:00 cron
4 0 681 621 20 0 34496 2996 poll_s Sl ? 0:00 /usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Displays/_0
4 0 704 681 20 0 18620 9276 poll_s Ss+ tty7 0:00 /usr/bin/X :0 -background none -verbose -auth /var/run/gdm/auth-for-gdm-U58lKS/database -seat seat0 -nolisten tcp vt7
4 0 707 1 20 0 32604 3040 poll_s Sl ? 0:00 /usr/lib/accountsservice/accounts-daemon
4 0 713 1 20 0 32548 3540 poll_s Sl ? 0:00 /usr/lib/policykit-1/polkitd --no-debug
1 0 717 2 20 0 0 0 worker S ? 0:00 [kworker/0:2]
4 0 765 681 20 0 27592 3528 poll_s Sl ? 0:00 gdm-session-worker [pam/gdm-launch-environment]
1 0 779 1 20 0 2452 988 poll_s S ? 0:00 upstart-socket-bridge --daemon
1 0 783 1 20 0 2884 1416 poll_s S ? 0:00 upstart-file-bridge --daemon
1 0 801 2 20 0 0 0 kaudit S ? 0:00 [kauditd]
1 0 818 1 20 0 3968 2100 poll_s Ss ? 0:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
4 0 914 1 20 0 5592 2060 poll_s Ss ? 0:00 /usr/sbin/sshd -D
4 111 938 765 20 0 18472 4608 poll_s Ss ? 0:00 /usr/bin/gnome-session --autostart /usr/share/gdm/greeter/autostart
1 111 944 1 20 0 2776 488 poll_s S ? 0:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/gnome-session --autostart /usr/share/gdm/greeter/autostart
4 0 964 1 20 0 6452 2904 poll_s Ss ? 0:00 /usr/sbin/modem-manager
1 111 967 1 20 0 2856 872 SyS_ep Ss ? 0:00 //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
1 0 971 1 20 0 7268 3220 poll_s Ss ? 0:01 /usr/sbin/apache2 -k start
5 0 990 1 20 0 39240 5168 poll_s Ssl ? 0:00 NetworkManager
0 111 995 1 20 0 40488 2728 poll_s Sl ? 0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
0 111 1003 995 20 0 2748 1272 SyS_ep S ? 0:00 /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
0 111 1010 1 20 0 15212 2484 poll_s Sl ? 0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
5 33 1020 971 20 0 230948 2896 pipe_w Sl ? 0:00 /usr/sbin/apache2 -k start
5 33 1021 971 20 0 230756 2588 pipe_w Sl ? 0:00 /usr/sbin/apache2 -k start
4 0 1166 1 20 0 3368 712 n_tty_ Ss+ tty1 0:00 /sbin/getty -8 38400 tty1
4 0 1167 1 20 0 1616 640 n_tty_ Ss+ ttyO2 0:00 /sbin/getty 115200 ttyO2
4 0 1198 914 20 0 9136 2908 poll_s Ss ? 0:00 sshd: ubuntu [priv]
5 1000 1210 1198 20 0 9268 1596 poll_s S ? 0:00 sshd: ubuntu@pts/2
0 1000 1211 1210 20 0 5344 2780 wait Ss pts/2 0:00 -bash
4 0 1235 1211 20 0 4968 1368 wait S pts/2 0:00 su
4 0 1236 1235 20 0 4220 1652 wait S pts/2 0:00 bash
没有 sendmail 也没有其他 MTA,对吧?我的最后一个想法:cron 可能会尝试发送邮件。我通过设置关闭了 cron 的邮件功能MAILTO=""
,我的crontab
看起来像这样
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
5 */2 * * * root /root/ddclient-3.7.3.bash
15 */2 * * * ubuntu /home/ubuntu/public_html/testprovider/testHosts.bash
0 */4 * * * ubuntu /home/ubuntu/public_html/testprovider/evalHosts.bash
*/10 * * * * connectX /home/connectX/public_html/startServers.bash
继续愚蠢的窗户礼仪,重新启动但仍然 -sm-msp-queue
洪水syslog
和mail.log
。我该怎么做才能摆脱这些信息?
收到第一个答案后(非常感谢!)我检查了以下建议:
MTA没有启动?
显然不是,正如我所希望的那样:
telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
问题仍然存在:谁试图向邮件队列提供信息并产生这些错误消息?
发送了太多电子邮件?
如果是的话:现在会是谁呢?有人频繁地(每 20 分钟)尝试发送邮件:
Jan 11 12:20:04 BeagleBoard-xM sendmail[2136]: My unqualified host name (BeagleBoard-xM) unknown; sleeping for retry
Jan 11 12:21:04 BeagleBoard-xM sendmail[2136]: unable to qualify my own domain name (BeagleBoard-xM) -- using short name
Jan 11 12:21:04 BeagleBoard-xM sendmail[2136]: s0BBL4jU002136: from=smmsp, size=417, class=0, nrcpts=1, msgid=<201401111121.s0BBL4jU002136@BeagleBoard-xM>, relay=smmsp@localhost
Jan 11 12:21:04 BeagleBoard-xM sendmail[2136]: s0BBL4jU002136: to=root, ctladdr=smmsp (113/122), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30417, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jan 11 12:40:04 BeagleBoard-xM sendmail[2225]: My unqualified host name (BeagleBoard-xM) unknown; sleeping for retry
Jan 11 12:41:04 BeagleBoard-xM sendmail[2225]: unable to qualify my own domain name (BeagleBoard-xM) -- using short name
Jan 11 12:41:04 BeagleBoard-xM sendmail[2225]: s0BBf4aZ002225: from=smmsp, size=417, class=0, nrcpts=1, msgid=<201401111141.s0BBf4aZ002225@BeagleBoard-xM>, relay=smmsp@localhost
Jan 11 12:41:04 BeagleBoard-xM sendmail[2225]: s0BBf4aZ002225: to=root, ctladdr=smmsp (113/122), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30417, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jan 11 13:00:03 BeagleBoard-xM sendmail[2740]: My unqualified host name (BeagleBoard-xM) unknown; sleeping for retry
Jan 11 13:01:03 BeagleBoard-xM sendmail[2740]: unable to qualify my own domain name (BeagleBoard-xM) -- using short name
Jan 11 13:01:03 BeagleBoard-xM sendmail[2740]: s0BC13pA002740: from=smmsp, size=417, class=0, nrcpts=1, msgid=<201401111201.s0BC13pA002740@BeagleBoard-xM>, relay=smmsp@localhost
Jan 11 13:01:03 BeagleBoard-xM sendmail[2740]: s0BC13pA002740: to=root, ctladdr=smmsp (113/122), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30417, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jan 11 13:20:04 BeagleBoard-xM sendmail[2832]: My unqualified host name (BeagleBoard-xM) unknown; sleeping for retry
Jan 11 13:21:04 BeagleBoard-xM sendmail[2832]: unable to qualify my own domain name (BeagleBoard-xM) -- using short name
Jan 11 13:21:04 BeagleBoard-xM sendmail[2832]: s0BCL4V0002832: from=smmsp, size=417, class=0, nrcpts=1, msgid=<201401111221.s0BCL4V0002832@BeagleBoard-xM>, relay=smmsp@localhost
Jan 11 13:21:04 BeagleBoard-xM sendmail[2832]: s0BCL4V0002832: to=root, ctladdr=smmsp (113/122), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30417, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
在我看来,唯一的候选人仍然是 cron,应该不是这样做是为了crontab
提供一个空地址,以防止 cron 发送邮件。
邮件服务器被用来发送垃圾邮件?
好吧——这将是最糟糕的情况,我试图通过不是操作任何 MTA。不幸的是,我无法保证系统不会被滥用,但这种情况不太可能发生,因为我刚刚设置了 BeagleBoard 并在路由器上使用专用端口转发。路由器确实不是转发除 SSH / HTTP / HTTPS 之外的其他端口以及十个专用端口(4753 - 4762)用于我的Java 应用程序。
答案1
cron 驯服了,完成了
我仔细查看了一下,发现了两个我搞乱的配置
/etc/cron.d/sendmail
/etc/mail/sendmail.conf
第一个负责频繁尝试,因此每 20 分钟发送一次邮件或每 10 分钟处理一次邮件队列。我刚刚将两行调用改为sendmail
注释。
#------------------------------------------------------------------------------
# Every so often, give sendmail a chance to run the MSP queues.
#
# */20 * * * * smmsp test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
#
#------------------------------------------------------------------------------
# Every so often, give sendmail a chance to run the MTA queues.
# Will also run MSP queues if enabled
#
# */10 * * * * root test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-mta
#
#------------------------------------------------------------------------------
第二个似乎是第一个所衍生的某个模板。我在那里更改了一些行,希望它能阻止任何后续(自动)重新配置启动任何 MTA。这些后来的更改有一天可能会变成一场灾难。
我做了一些清理工作,
rm /var/spool/mqueue/*
rm /var/spool/mqueue-client/*
重新启动了 cron( service cron restart
) 并希望syslog
将来能够保持清洁...
答案2
你为什么不尝试apt-get autoremove
我会向你展示我的情况
- 我已经安装了 ssmtp
- 我已经卸载了 ssmtp
- 我已经安装了 sendmail-bin
- 我已经卸载了 sendmail-bin
- 我已经安装了 ssmtp
我也遇到过和你一样的问题。每 20 分钟 Cron 就会向我发送一封没有任何意义的 cronjob 输出邮件,这是一种错误。当时 /etc/cron.d/ 目录中有一个“sendmail”文件。我尝试通过执行 删除 sendmail-bin 以确保它已被删除apt-get remove sendmail-bin。在输出结果中,有一条信息表明某些包不再需要。然后我执行了apt-get autoremove。之后 /etc/cron.d/sendmail 消失了,cron 邮件发送也停止了。谢谢。
答案3
可能存在以下原因:
- 您的 MTA 尚未启动。
- 您同时发送了太多电子邮件,您的 MTA 无法处理。
- 您的邮件服务器正被用来发送垃圾邮件(表面上是这样的,但实际上可能不止这些)。停止服务器,找出他们发送电子邮件的方式,从队列中删除这些邮件,保护您的服务器,然后重新启动。