[collectd] localstatedir patches

Boian Berberov bberberov at gmail.com
Fri Sep 12 16:35:53 CEST 2008


On Fri, Sep 12, 2008 at 06:59, Sebastian Harl <sh at tokkee.org> wrote:

> Hi,
>
> On Fri, Sep 12, 2008 at 06:43:11AM -0600, Boian Berberov wrote:
> > Let me illustrate exactly what happens on Gentoo.  The econf function
> used
> > by ebuilds makes this call:
> > ./configure --prefix=/usr --host=x86_64-pc-linux-gnu
> --mandir=/usr/share/man
> > --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
> > --localstatedir=/var/lib --localstatedir=/var <plugin-enables> ...
> >
> > The second "--localstatedir=/var" is an override I have to put in. Since
> > prefix is set to /usr, the end result in the collectd.conf file without
> the
> > patch to that file is:
> > ...
> > #BaseDir     "/usr/var/lib/collectd"
> > #PIDFile     "/usr/var/run/collectd.pid"
> > ...
> >
> > With the patch it is:
> > ...
> > #BaseDir     "/var/lib/collectd"
> > #PIDFile     "/var/run/collectd.pid"
> > ...
>
> Okay, I guess, I forgot to mention that in my first reply: This is a
> known problem. The fix you proposed in your patch does not work for the
> reasons mentioned before. The only way to fix that is to do some
> sed-magic in the Makefile which takes care of the required substitutions
> in collectd.conf(.in). This will work as that's executed at compile time
> as well and ${prefix} is then substituted with the correct value.
>
> However, I don't really understand why any distributor would want to use
> the shipped config file in their packages. Usually you'd want to provide
> some more reasonable default config (the shipped config enables _all_
> plugins that have been built which, imho, is not reasonable for a
> distributor). In the Debian package, I've included my own config with
> appropriate paths. I guess, about anybody else does so as well, so
> nobody stepped up to fix this problem so far.
>
> Anyway, if you provide a patch that implements that sed-magic, I'm
> pretty sure this could be included in collectd.
>
> > Setting prefix to "/" will install everything else in root.  Do you have
> any
> > suggestion on how I can set this up without the patch?  Of course it can
> > always be maintained externally.
>
> Ship your own config ... ;-)
>
> HTH,
> Sebastian
>
> --
> Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/
>
> Those who would give up Essential Liberty to purchase a little Temporary
> Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIymfMEFEKc4UBx/wRAidBAJ4wAqTD1UDMJDskkcVRH0MDHfEh8gCfWpfz
> pKFguPhX3TPj8QNiRKWfRHA=
> =DQ6B
> -----END PGP SIGNATURE-----
>
>
Excellent idea!  sed-magic would be easier to maintain.  I do not know if I
can integrate the sed-magic in the Makefile effectively, but if I do I will
post the patch.

I should probably look at making a Gentoo-specific config file, but at this
point I was trying to use the one you provide as a reasonable template that
users can look at when making their own.

Boian Berberov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20080912/29eaabcc/attachment.htm 


More information about the collectd mailing list