[collectd] localstatedir patches

Boian Berberov bberberov at gmail.com
Fri Sep 12 14:43:11 CEST 2008


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

> Hi,
>
> On Thu, Sep 11, 2008 at 01:38:00PM -0600, Boian Berberov wrote:
> > OK.  But how does your example work?  I think in Gentoo it would have to
> be:
> > ./configure --prefix=${custom_prefix}
> --localstatedir=${custom_prefix}/bar
>
> No, you'd still use --localstatedir='${prefix}/bar'. ${prefix} will be
> used in the configure script and Makefile and thus evaluated at compile
> time which allows you to set a new prefix without recreating the build
> environment.
>
> Please note that you don't _have_ _to_ use that syntax but it's
> recommended for the above mentioned reasons.
>
> As a side-note: --localstatedir='${prefix}/foo' was a pretty bad
> example. Usually, Linux distributors set prefix to '/usr' and
> localstatedir to '/var' to comply with the FHS. However, ${prefix} is
> used e.g. in -mandir='${prefix}/share/man'.
>
> > Also, localstatedir defaults to [PREFIX/var] according to ./configure
> > --help, so that particular case should be covered for var.
>
> Right - see above ;-)
>
> HTH,
> Sebastian
>
> PS: Please don't use top-posting style [1] - that usually breaks
>    readability a lot. Thanks!
>
> [1] http://en.wikipedia.org/wiki/Posting_style#Top-posting
>
> --
> 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)
>
> iD8DBQFIykRqEFEKc4UBx/wRAj6pAJ4n+FFX5nnp4crwGIgrmiyWod28GgCdGQk0
> j3u7kH7F15DwNLPjLaXA1b0=
> =E1u7
> -----END PGP SIGNATURE-----
>
>
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"
...

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.

There is also sysconfdir, but I need to look at making another patch about
ssl first.

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


More information about the collectd mailing list