【问题标题】:Munin unable to copy contents while running munin-cronMunin 在运行 munin-cron 时无法复制内容
【发布时间】:2014-08-04 22:14:33
【问题描述】:

我最近在我的(基于 Fedora 的)服务器上安装了 munin。现在,我想在一个静态目录中获取所有图表(该应用程序在 Django 上运行)。因此,我通过将htmldir 设置为我的静态文件夹的绝对路径来编辑文件\etc\munin\munin.conf。然后,当我执行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-ed 静态目录(递归用于 munin 用户),甚至尝试使用chmod 777(实际上不应该这样做),所以基本上它似乎没有是权限问题。

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

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

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。会不会是配置问题?

【问题讨论】:

    标签: django ubuntu cron fedora munin


    【解决方案1】:

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

    • 在root的crontab下触发cron:
      • 将此添加到 root 的 crontab */5 * * * * sudo -u munin crontab -e
      • 在/etc/sudoers 中注释掉这行Defaults requiretty

    【讨论】:

      猜你喜欢
      • 2014-06-14
      • 1970-01-01
      • 2015-04-18
      • 2012-02-26
      • 1970-01-01
      • 2012-10-05
      • 1970-01-01
      • 2016-03-05
      • 1970-01-01
      相关资源
      最近更新 更多