[collectd] 4.2.1 on Solaris 10

Sebastian Harl sh at tokkee.org
Wed Dec 5 20:37:28 CET 2007


Hi Christophe,

On Wed, Dec 05, 2007 at 09:40:20AM -0500, Christophe Kalt wrote:
> 	 gcc -DHAVE_CONFIG_H -I. -I. -I. -I/z/pkgs/collectd-4.2.1/include -I/usr/sfw/include -Wall -Werror -L/z/pkgs/collectd-4.2.1/lib -L/usr/
> 	sfw/lib -MT apcups.lo -MD -MP -MF .deps/apcups.Tpo -c apcups.c  -fPIC -DPIC -o .libs/apcups.o
> 	In file included from collectd.h:26,
> 			 from apcups.c:34:
> 	config.h:832:1: error: "_FILE_OFFSET_BITS" redefined
> 	In file included from /usr/include/iso/stdlib_iso.h:30,
> 	*** Error code 1
> 			 from /usr/include/stdlib.h:18,
> 			 from apcups.c:32:
> 	/z/pkgs/gcc-4.1.2/lib/gcc/i386-pc-solaris2.10/4.1.2/include/sys/feature_tests.h:197:1: error: this is the location of the previous defi
> 	nition
> 	make: Fatal error: Command failed for target `apcups.lo'
> 	*** Error code 1

_FILE_OFFSET_BITS gets defined by the AC_SYS_LARGEFILE autoconf macro, thus
I'd consider this to be a bug in autoconf. As a temporary workaround we could
disable the macro for Solaris - that'll be a bad hack though, which I don't
really like.

You should file a bug against autoconf (I assume you're using GNU autoconf).

> This one appears in multiple plugins:
> 
> 	 gcc -DHAVE_CONFIG_H -I. -I. -I. -I/z/pkgs/collectd-4.2.1/include -I/usr/sfw/include -Wall -Werror -L/z/pkgs/collectd-4.2.1/lib -L/usr/
> 	sfw/lib -MT email.lo -MD -MP -MF .deps/email.Tpo -c email.c  -fPIC -DPIC -o .libs/email.o
> 	email.c: In function 'open_connection':
> 	*** Error code 1
> 	email.c:548: error: too many arguments to function 'getgrnam_r'

D'oh... a lot of those *_r functions seem to be quite system-dependent. Can
you please provide the definition of getgrnam_r() as defined on Solaris
(simply providing the appropriate part of the manpage should be fine)?

> Now, more tricky is this:
> 
> 	 gcc -DHAVE_CONFIG_H -I. -I. -I. -I/z/pkgs/collectd-4.2.1/include -I/usr/sfw/include -Wall -Werror -L/z/pkgs/collectd-4.2.1/lib -L/usr/
> 	sfw/lib -MT swap.lo -MD -MP -MF .deps/swap.Tpo -c swap.c  -fPIC -DPIC -o .libs/swap.o
> 	swap.c: In function 'swap_read':
> 	swap.c:195: error: storage size of 'ai' isn't known
> 	cc1: warnings being treated as errors
> 	swap.c:197: warning: implicit declaration of function 'swapctl'
> 	swap.c:197: error: 'SC_AINFO' undeclared (first use in this function)
> 	swap.c:197: error: (Each undeclared identifier is reported only once
> 	swap.c:197: error: for each function it appears in.)
> 	swap.c:195: warning: unused variable 'ai'
> 	*** Error code 1
> 	make: Fatal error: Command failed for target `swap.lo'
> 	*** Error code 1

Looks like some libkstat related errors. Can you please check for the presence
of kstat.h and libkstat (and the appropriate configure check output) and
documentation about "struct anoninfo" and swapctl() (I suppose this can be
found in the same manpage - I did never work with libkstat though...)?
Providing appropriate parts of the documentation might help again ;-)

> Looking into it shows that configure failed the test for sys/swap.h:
> 
> 	configure:23197: checking for sys/swap.h
> 	configure:23225: gcc -c -L/z/pkgs/collectd-4.2.1/lib -L/usr/sfw/lib -I/z/pkgs/collectd-4.2.1/include -I/usr/sfw/include conftest.c >&5
> 	In file included from conftest.c:66:
> 	/usr/include/sys/swap.h:50:2: error: #error "Cannot use swapctl in the large files compilation environment"

Hum.... I should have read all of your e-mail before answering parts of it ;-)

> That's really furstrating (for me anyhow).  The whole reason i'm
> here in the first place is to get LFS working to silence these:
> 	collectd[1554]: statv?fs failed: Value too large for defined data type

... that kinda sucks. I'll try to look for some LFS on Solaris related
documentation some time... :-/

> collectd 4.2.1 seems to enable LFS automagically by default
> (which is as it should be), but this basically guarantees
> you'll never have a working swap plugin on Solaris (where LFS
> is very old news).  I think reverting to reading the output
> from "swap -s" is probably your best bet, not sure how to best
> do this within the current framework.  Ideally, i'd like to
> see this done transparently for the user, of course, it can
> easily be done via the exec plugin (well, once i port that
> one).

As mentioned above LFS is enabled by using the AC_SYS_LARGEFILE autoconf
macro. Can you please check how "swap -s" gets the values on Solaris? Forking
a process each interval is a rather bad idea...

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

-------------- 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/20071205/eae45810/attachment.pgp 


More information about the collectd mailing list