2

我最近在我的(基于 Fedora 的)服务器上安装了 munin。现在,我想在一个静态目录中获取所有图表(该应用程序在 Django 上运行)。因此,我\etc\munin\munin.conf通过将 设置htmldir为静态文件夹的绝对路径来编辑文件。然后,当我执行 a 时munin-cron,出现以下错误:

This program will easily break if you run it as root as you are
trying now.  Please run it as user 'nobody'.  The correct 'su' command
on many systems is 'su - munin --shell=/bin/bash'
Aborting.

因此,我更改了用户并尝试以munin用户身份运行相同的用户。然后我收到以下错误:

[ERROR] Could not copy contents from /etc/munin/static/ to /[path to static 
file] at /usr/share/perl5/vendor_perl/Munin/Master/HTMLOld.pm line 716.

chown编辑了静态目录(对于munin用户递归),甚至尝试过chmod 777(实际上不应该这样做),所以基本上它似乎不是权限问题。

此外,我的开发服务器基于 Ubuntu (12.04)。它在那里工作得很好。即使我的本地机器运行 Ubuntu (14.04),它也能正常工作。这可能是操作系统问题吗?这似乎极不可能。我还能错过什么?任何帮助,将不胜感激。

PS:还有一个问题。当我munin-cron在我的 Ubuntu(s) 中以 root 身份运行时,它给出的错误是:

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.

而它在nobody这里。会不会是配置问题?

4

1 回答 1

0

我在 CentOS 6.5 上遇到了同样的问题。没有可能的权限解决了这个问题。所以我不得不代表 munin 用户在 root 的 crontab 下运行 cron。听起来很疯狂,但它确实有效:

  • 在root的crontab下触发cron:
    • 将此添加到 root 的 crontab*/5 * * * * sudo -u munin crontab -e
    • 注释掉这一Defaults requiretty/etc/sudoers
于 2015-07-23T12:08:46.753 回答