[collectd] patch fixing collectd.conf.in template path

Florian Forster octo at verplant.org
Thu Jun 19 14:20:14 CEST 2008


Hi Christian,

On Thu, Jun 19, 2008 at 12:13:14PM +0200, Christian Wiese wrote:
> -#BaseDir     "@prefix@/var/lib/@PACKAGE_NAME@"
> -#PIDFile     "@prefix@/var/run/@PACKAGE_NAME at .pid"
> +#BaseDir     "@localstatedir@/lib/@PACKAGE_NAME@"
> +#PIDFile     "@localstatedir@/run/@PACKAGE_NAME at .pid"

I know this is a bit messy and in fact we used @localstatdir@ at first.
The problem is, that if you don't explicitely use the
`--localstatedir' option of the configure script, this will expand to
`${prefix}/var', i. e. the $prefix variable is _not_ expanded.

_A_ solution may be to expand the variable in the configure script. I'm
not sure if there is a nice way to do this, but
  EXPANDED_LOCALSTATEDIR="`eval echo $localstatedir`"
  AC_SUBST(EXPANDED_LOCALSTATEDIR)
should work.

So far I did not put more effort into this, because I expect that mostly
package maintainers of binary packages will run into this - and in my
experience many of them ship their own version of the config file, one
that is tailored to the needs of the distribution in question.

If you (or anyone else on the list) knows a nice and clean way to expand
these variables, a solution using AC_SUBST would be the way to go. But
if you really need this changed, the `eval' approach would be okay, too.

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080619/7d9d2f72/attachment.pgp 


More information about the collectd mailing list