[collectd] localstatedir patches

Sebastian Harl sh at tokkee.org
Thu Sep 11 19:55:49 CEST 2008


Hi Boian,

On Thu, Sep 11, 2008 at 11:44:03AM -0600, Boian Berberov wrote:
> I was working on updating Gentoo's ebuild and I noticed that localstatedir
> was not used in certain places.  Please review these patches and consider
> them.

> --- src/collectd.conf.in.orig	2008-09-11
> +++ src/collectd.conf.in	2008-09-11
> @@ -6,8 +6,8 @@
>  
>  #Hostname    "localhost"
>  FQDNLookup   true
> -#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"

That does not work, if you're using e.g. "./configure --prefix=/foo
--localstatedir=\${prefix}/bar" (which is very common in e.g. Debian
source packages) as this would end up as "${prefix}/bar" in the config
file.

> --- src/powerdns.c.orig	2008-09-11
> +++ src/powerdns.c	2008-09-11
> @@ -45,10 +45,10 @@
>  #endif
>  #define FUNC_ERROR(func) do { char errbuf[1024]; ERROR ("powerdns plugin: %s failed: %s", func, sstrerror (errno, errbuf, sizeof (errbuf))); } while (0)
>  
> -#define SERVER_SOCKET  "/var/run/pdns.controlsocket"
> +#define SERVER_SOCKET  LOCALSTATEDIR"/run/pdns.controlsocket"
>  #define SERVER_COMMAND "SHOW *"
>  
> -#define RECURSOR_SOCKET  "/var/run/pdns_recursor.controlsocket"
> +#define RECURSOR_SOCKET  LOCALSTATEDIR"/run/pdns_recursor.controlsocket"
>  #define RECURSOR_COMMAND "get noerror-answers nxdomain-answers " \
>    "servfail-answers sys-msec user-msec qa-latency cache-entries cache-hits " \
>    "cache-misses questions"

Signed-off-by: Sebastian Harl <sh at tokkee.org>

Cheers,
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

-------------- 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/20080911/790b97b3/attachment.pgp 


More information about the collectd mailing list