where to set default permissions for new .rrd files

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
mgdkacti
Posts: 31
Joined: Mon Dec 12, 2011 6:36 pm

where to set default permissions for new .rrd files

#1 Post by mgdkacti » Tue Feb 21, 2012 1:52 pm

Cacti creates .rrd files in the cactipath/rra folder when new data sources are created via the GUI. I just noticed that when I create a new data source, the permissions/ownership are as follows:

-rw-r--r-- 1 cacti cacti filename.rrd.

However, I need the permissions to be:

-rwxrwxr-x cacti www-data filename.rrd or the graphs do not appear.

The root permissions on the rra folder are: -rwxrwxr-x cacti www-data so I thought that any file created within this folder would have the permissions of the parent, but this is not the case. Where do I set the default permissions for newly created .rrd files?

c3226026
Cacti User
Posts: 87
Joined: Mon Jan 17, 2011 12:15 pm

Re: where to set default permissions for new .rrd files

#2 Post by c3226026 » Tue Feb 21, 2012 2:19 pm

Hello mgdkacti,

.rrd files are create by the user who use poller.php.

so I suppose than in your crontab you've something like this :

*/5 * * * * cacti php cactipath/poller.php ....

I suppose also than cacti user is on the www-data group

so in this case, you can done something like this (as write on cacti installation documentation) :

chmod -R 775 cactipath/rra

and

chown -R cacti:www-data cactipath/rra/

Normaly now all existing .rrd files and new .rrd file have the good permissions.

mgdkacti
Posts: 31
Joined: Mon Dec 12, 2011 6:36 pm

Re: where to set default permissions for new .rrd files

#3 Post by mgdkacti » Tue Feb 21, 2012 2:39 pm

Thank you for the response, but that is what I am trying to avoid. After, I create the new data source, the rrd file is created, but with the wrong ownership and permissions. So, after the fact, I have to manually go into the rra directory and issue commands similar to what you indicated. Yes, poller.php is run as "cacti" user, but this is not what creates the .rrd file in the first place.

mgdkacti
Posts: 31
Joined: Mon Dec 12, 2011 6:36 pm

Re: where to set default permissions for new .rrd files

#4 Post by mgdkacti » Wed Feb 22, 2012 12:39 pm

I found a partial answer. On the Data Source page within the Cacti Gui, if you Turn On Data Source Debug Mode, you can see the output for the creation of the RRD file. So, the file rrdtool is used to create the .rrd tool. All i need to do now, is find what .php script calls rrdtool...which is some sort of program...since it can only be partially read via cat or vi.

Data Source Path
The full path to the RRD file.

Data Source Debug

/usr/bin/rrdtool create \
/usr/share/cacti/rra/nakusplinkstatus_99.rrd \
--step 300 \
DS:nakusplinkstatus:GAUGE:600:2:11 \
RRA:AVERAGE:0.5:1:500 \
RRA:MAX:0.5:1:500 \

noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: where to set default permissions for new .rrd files

#5 Post by noname » Tue Feb 28, 2012 1:21 am

mgdkacti wrote: I just noticed that when I create a new data source, the permissions/ownership are as follows:

-rw-r--r-- 1 cacti cacti filename.rrd.
That's normal.
mgdkacti wrote: The root permissions on the rra folder are: -rwxrwxr-x cacti www-data so I thought that any file created within this folder would have the permissions of the parent, but this is not the case.
Probably that's the case of Windows.
On *NIX, it depends on the user-specific settings (e.g. /etc/passwd, /etc/group, umask).

I think the minimum essentials of owner/group/permissions are like this:

Code: Select all

% ls -ld rra
drwxr-xr-x  cacti www-data  rra/

% ls -ld log
drwxr-xr-x  cacti www-data  log/

% ls -l log/cacti.log
-rw-rw-r--  cacti www-data  cacti.log

Post Reply