Nginx – munin-cron Unable to Copy Contents

crondjangofedoramuninnginx

I recently installed munin on my (Fedora12 based) server. Now, I wanted to get all the graphs in a static directory (The application runs on Django). So, I edited the file /etc/munin/munin.conf by setting the htmldir as the absolute path to my static folder. Then, when I did a munin-cron, I got the following error:

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.

So, I changed the user and tried running the same with munin as a user. I then got the following error:

[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.

I chown-ed the static directory (recursively for the munin user) and even tried with chmod 777 (which actually one shouldn't do), so basically it doesn't seem to be a permission issue.

Also, my dev server is Ubuntu (12.04) based. It worked fine there. It worked fine even with my local machine running Ubuntu (14.04). Can this be an OS issue? That is highly unlikely it seems. What other thing could I be missing? Any help would be appreciated.

PS: There is one more catch. When I ran munin-cron as root in my Ubuntu(s), the error it gave was:

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.

whereas it was nobody here. Can it be a configuration issue?

My munin version is 2.0.16.

Best Answer

You should never run munin-cron with 'root' user.

Try running this command:

 chown -R munin:munin  /var/www/munin

After this try running "munin-cron" back from the "munin" user.

Related Topic