我们有一个 Munin 服务器,它最近出现了一些非常奇怪的行为。该网站本身运行良好,我们正在获取统计数据,我正在分页,一切都很好,除了......每 5 分钟我收到一封电子邮件,上面写着:
/bin/sh: 1: munin: not found
This program will easily break if you run it as root as you are
trying now. Please run it as user 'munin'. The correct 'su' command
on many systems is 'su - munin --shell=/bin/bash'
Aborting.
所以,我认为 /etc/cron.d/munin-node 中的 crontab 的用户名错误,对吧?不...
#
# cron-jobs for munin-node
#
MAILTO=root
# If the APT plugin is enabled, update packages databases approx. once
# an hour (12 invokations an hour, 1 in 12 chance that the update will
# happen), but ensure that there will never be more than two hour (7200
# seconds) interval between updates..
*/5 * * * * munin if [ -x /etc/munin/plugins/apt_all ]; then munin-run apt_all update 7200 12 >/dev/null; elif [ -x /etc/munin/plugins/apt ]; then munin-run apt update 7200 12 >/dev/null; fi
我什至完全删除了文件 /etc/cron.d/munin-node 并且它仍然继续运行,就好像它在那里一样,并且它正在尝试以 root 身份运行。
而且,当然,统计数据会按时显示。这让我发疯了,因为我每 5 分钟就会收到一封垃圾邮件。
你检查过 root 的 crontab 吗?以 root 身份使用
crontab -l
以获取它的列表。未能在通常的地方看看