Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126228 - Cacti ebuild change attributes of scripts
Summary: Cacti ebuild change attributes of scripts
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Lance Albertson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-14 15:54 UTC by Jesus de Santos Garcia
Modified: 2009-05-27 05:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesus de Santos Garcia 2006-03-14 15:54:34 UTC
When I upgrade my cacti (last version tested: 0.8.6h_p20060108) the files inside the scripts directory (cacti/scripts) are changed in this way:

 - Execution attribute is removed
 - owner and group is set to root

So, whenever I upgrade my cacti I have to do:

chmod 700 *
chgrp cacti *
chown cacti *

I don't know exactly if this is a bug, but it is really annoying
Comment 1 Lance Albertson (RETIRED) gentoo-dev 2006-04-01 14:54:28 UTC
I wonder if this is the intended result from webapp-config. What version of webapp-config are you running?

Webapp folks: Can you confirm this assumption and possibly offer me any advice for a good solution to the issue?

Thanks-
Comment 2 Jesus de Santos Garcia 2006-04-02 07:24:02 UTC
> I wonder if this is the intended result from webapp-config. What version of
> webapp-config are you running?

webapp-config version in my machine is 1.50.13
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2007-01-08 21:58:01 UTC
If I understood correctly cacti internally executes perl /path/to/script fex,
perl /var/www/localhost/htdocs/cacti/scripts/query_unix_partitions.pl index

At least I see such behavior at cacti version 0.8.6i. So I think you do not need neither make contents of scripts directory executable nor chown them.

Jesus: Thus Why do you need to add cacti user/group and set executable permitions? What does not work?

Lance: AFAIU webapp-config/webapp.eclass preserves permissions for files and directories. Citation from webapp.eclass: "For now, we just make sure that root owns everything, and that there are no setuid files." Thus may be it's better to do 'cp -rp' inside ebuild instead of 'cp -r', but the result is the same :)
Comment 4 Jesus de Santos Garcia 2007-01-09 01:33:11 UTC
(In reply to comment #3)

> Jesus: Thus Why do you need to add cacti user/group and set executable
> permitions? What does not work?

exec permission doesn't seem to be necessary. But i have to chown the script to cacti or i get the following error:

01/09/2007 02:15:07 AM - CMDPHP: Poller[0] Host[3] DS[77] WARNING: Result from CMD not valid.  Partial Result:
01/09/2007 02:15:07 AM - CMDPHP: Poller[0] Host[3] DS[78] WARNING: Result from CMD not valid.  Partial Result:
01/09/2007 02:15:07 AM - CMDPHP: Poller[0] Host[3] DS[79] WARNING: Result from CMD not valid.  Partial Result:

Comment 5 Peter Volkov (RETIRED) gentoo-dev 2007-01-09 08:40:33 UTC
(In reply to comment #4)
> exec permission doesn't seem to be necessary. But i have to chown the script 
> to cacti or i get the following error:
> 
> 01/09/2007 02:15:07 AM - CMDPHP: Poller[0] Host[3] DS[77] WARNING: Result from
> CMD not valid.  Partial Result:

Well. But then could you please describe the sequence of operations how to get this error message? What you have configured and where do you look for error message?
Comment 6 Jesus de Santos Garcia 2007-01-10 12:18:39 UTC
My problem is that I am invoking the poller from cron:

*/5   *  * * *  cacti  /usr/bin/php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1

as cacti user.

So, this is why I have to chown the scripts each time I emerge a new cacti ebuild.

Probably this is not a real bug and could be closed.
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2007-01-16 21:29:34 UTC
By default you should have files in scripts directory world readable. At least I have the following permisions: root:root -rw-r--r--. And there is no need to chown/chmod files. If you have something different reopen then.

BTW. Note 0.8.6i-r1 comes into stable due to security vulnerabilities (bug 159278). Thus use that version :-)
Comment 8 Chris Gianelloni 2009-05-27 05:07:15 UTC
In case anyone reads this later, the problem is the templates that you're using.  All templates should specify the full PATH to the script, and also the interpreter used to call the script.  They shouldn't rely on things like executable bits, or they're not very portable.