[collectd] rrdc_update failed with status -1

Benjamin DUPUIS benjamin.dupuis at quake.fr
Fri Mar 30 14:56:55 CEST 2012


Here is the patch, for "mkdir 777"

In Redhat "/etc/init.d/functions" contains a "umask 0022" and the init script of collectd source it. 
I don't know if it's the same for other releases, but, perhaps it'll be a good idea to create a "/etc/default/$prog" which contain an umask 0022.
$prog have not the same value for redhat (collectdmon), sles10/fedora (collectd)
For AIX init script already have a umask 022

Best regards



----- Message d'origine -----
De: Bruno Prémont <bonbons at linux-vserver.org>
Date: Thu, 29 Mar 2012 13:35:39 +0200
Sujet: Re: [collectd] rrdc_update failed with status -1
À: Benjamin DUPUIS <benjamin.dupuis at quake.fr>
Cc: collectd at verplant.org

>On Thu, 29 Mar 2012 13:25:30 Benjamin DUPUIS wrote:
>> umask in init script doesn't work for me (RHEL5).
>
>As documented in mkdir()'s manpage, the mask specified has umask
>applied on it. If the specified mode is more restrictive than umask it
>will win, thus mode should first be set to permissive, e.g. 0777, and
>then umask will work.
>
>> I never coded in C, only C++ for more than 10 years ago :)
>
>Adding umask as configuration option is slightly harder but should be
>easy looking at how other global options are defined.
>
>The change you listed as one-liner looks good to me, just check the
>rest of collectd code for more mkdir() invocations and send the patch
>(which you can obtain it with `git patch --path-with-stat` if you
>previously cloned git repo)
>
>Best regards,
>Bruno
>
>> ----- Message d'origine -----
>> De: Bruno Prémont <bonbons at linux-vserver.org>
>> Date: Thu, 29 Mar 2012 12:00:12 +0200
>> Sujet: Re: [collectd] rrdc_update failed with status -1
>> À: Benjamin DUPUIS <benjamin.dupuis at quake.fr>
>> Cc: collectd at verplant.org
>> 
>> >On Thu, 29 Mar 2012 11:46:16 Benjamin DUPUIS wrote:
>> >> I've modified
>> >> * src/collectd.c Line 211 : if (mkdir (orig_dir, 0775) == -1)
>> >> * src/common.c   Line 551 : if (mkdir (dir, 0775) == 0)
>> >> 
>> >> It's now working.
>> >> I don't know if it's a good solution perhaps it'll be a good idea to
>> >> have a configuration entry in the configuration of rrdcached /
>> >> rrdtools ?
>> >
>> >I think it would even be better to change mode to 0777 and let umask do
>> >the whole work, eventually having global umask configuration option in
>> >collectd config file so umask setting does not have to be delegated to
>> >init script (where it is not set and thus depends on umask of init or
>> >the shell [re]starting the daemon).
>> >
>> >The same has to apply for csv and the other write plugins that may
>> >create new files.
>> >
>> >Having configurable mode gets hard, especially as then on might also
>> >want to control owner/group and possibly ACLs or more!
>> >
>> >Would you mind creating a patch for it?
>
>_______________________________________________
>collectd mailing list
>collectd at verplant.org
>http://mailman.verplant.org/listinfo/collectd
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkdir_perms.patch
Type: application/octet-stream
Size: 735 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20120330/f67bc506/attachment.obj>


More information about the collectd mailing list