syslog-ng-3.2.4

Syslog-NG to ulepszony system zbierania i zarządzania logami systemowymi. Potrafi zbierać logi z różnych źródeł, przez udp i tcp i zapisywać je w różnych formatach i miejscach (pliki, bazy danych itp.).

Poniżej zapis sesji konfiguracji i kompilacji Syslog-ng 3.2.4. Skrypt w załączeniu.


soft@wega:~/syslog-ng% ./drf_syslog-ng-3.2.4_conf 
cc: Sun C 5.10 SunOS_sparc 2009/06/03
usage: cc [ options] files.  Use 'cc -flags' for details
MANPATH=/usr/local/share/man:/usr/local/man:/usr/share/man
PATH=/usr/local/bin:/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin
CFLAGS=-fast
CPPFLAGS=-I/usr/local/include
CXXFLAGS=-fast
LDFLAGS=-L/usr/local/lib -R/usr/local/lib
=============================================
dmake clean [y|n] ?
n
=============================================
configure [y|n] ?
y
...
checking for EVTLOG... yes
checking for TCP wrapper library... 
checking whether to enable TCP wrapper support... no
checking for dlsym in -ldl... yes
checking for LIBDBI... no
checking for dbi_initialize in -ldbi... no
checking whether to enable SQL support... no
checking for GLIB... no
configure: error: Package requirements (glib-2.0 >= 2.10.1 gmodule-2.0) were not met:

sh: gnome-config: not found
No package 'glib-2.0' found
sh: gnome-config: not found
No package 'gmodule-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
=============================================

Jak widać brakuje mu GLib do kompilacji, trzeba więc oderwać się na jakiś czas i skompilować GLib.

Podejście drugie:


configure [y|n] ?
y
...
syslog-ng Open Source Edition 3.2.4 configured
 Compiler options:
  compiler                    : cc -xc99=all
  compiler options            : -fast -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -I/usr/local/include/eventlog       -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
  linker flags                : -L/usr/local/lib -R/usr/local/lib -lpthread 
  prefix                      : /usr/local/syslog-ng-3.2.4
  linking mode                : dynamic
 Features:
  Sun STREAMS support (module): yes
  Debug symbols               : no
  GCC profiling               : no
  Memtrace                    : no
  IPV6 support                : yes
  spoof-source support        : no
  tcp-wrapper support         : no
  SSL support (module)        : no
  SQL support (module)        : no
  Linux capability support    : no
  PCRE support                : no
  Env wrapper support         : no
  systemd support             : no
  PACCT module (EXPERIMENTAL) : no
=============================================

Teraz lepiej. Można przejść do kompilacji:


dmake [y|n] ?
y
dmake  all-recursive
Making all in lib
dmake: Fatal error in reader: Makefile, line 644: Unexpected end of line seen
Current working directory /home/soft/syslog-ng/syslog-ng-3.2.4/lib

Poprzednie wersje potrafiły się skompilować Solarisowym make (dmake). Tu już coś „poprawili”, weźmy gmake. Teraz pójdzie już nieco dalej:


gmake [y|n] ?
y
gmake  all-recursive
gmake[1]: Entering directory `/home/soft/syslog-ng/syslog-ng-3.2.4'
Making all in lib
gmake[2]: Entering directory `/home/soft/syslog-ng/syslog-ng-3.2.4/lib'
gmake  all-am
gmake[3]: Entering directory `/home/soft/syslog-ng/syslog-ng-3.2.4/lib'
source='misc.c' object='misc.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --tag=CC   --mode=compile cc -xc99=all -DHAVE_CONFIG_H -I. -I..   -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -I/usr/local/include/eventlog       -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -fast -c -o misc.lo misc.c
libtool: compile:  cc -xc99=all -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/eventlog -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast -c misc.c  -KPIC -DPIC -o .libs/misc.o
source='utils.c' object='utils.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --tag=CC   --mode=compile cc -xc99=all -DHAVE_CONFIG_H -I. -I..   -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -I/usr/local/include/eventlog       -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -fast -c -o utils.lo utils.c
libtool: compile:  cc -xc99=all -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/eventlog -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast -c utils.c  -KPIC -DPIC -o .libs/utils.o
source='messages.c' object='messages.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --tag=CC   --mode=compile cc -xc99=all -DHAVE_CONFIG_H -I. -I..   -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -I/usr/local/include/eventlog       -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -fast -c -o messages.lo messages.c
libtool: compile:  cc -xc99=all -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/eventlog -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast -c messages.c  -KPIC -DPIC -o .libs/messages.o
"nvtable.h", line 108: warning: zero or negative subscript
"nvtable.h", line 116: warning: zero or negative subscript
"nvtable.h", line 101: warning: anonymous union declaration
"nvtable.h", line 172: zero or negative subscript
"nvtable.h", line 173: zero or negative subscript
"nvtable.h", line 169: warning: anonymous union declaration
"logmsg.h", line 124: warning: anonymous struct declaration
cc: acomp failed for messages.c
gmake[3]: *** [messages.lo] Error 1
gmake[3]: Leaving directory `/home/soft/syslog-ng/syslog-ng-3.2.4/lib'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/soft/syslog-ng/syslog-ng-3.2.4/lib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/soft/syslog-ng/syslog-ng-3.2.4'
gmake: *** [all] Error 2

Co nie znaczy, że do końca… Tu znów wychodzi pobłażliwość kompilatora GNU (gcc), który pozwala na definiowanie pustych tablic. Jak zajrzymy do pliku lib/nvtable.h i przejdziemy w okolice linii 170 to znajdziemy:


  union
  {
    guint32 __dummy_for_alignment;
    guint16 static_entries[0];
    gchar data[0];
  };

Zerowa wartość jest tu niedopuszczalna dla Sun Studio. Znalazłem jednak workaround, przytaczany czasem w sieci, aby zdefiniować wartość > 0. Zmieniam zatem w lib/nvtable.h na:


  union
  {
    guint32 __dummy_for_alignment;
    guint16 static_entries[1];
    gchar data[1];
  };

Kompilacja przechodzi kawałek dalej, jednak znów kończy się błędem:


/bin/bash ../libtool --tag=CC   --mode=compile cc -xc99=all -DHAVE_CONFIG_H -I. -I..   -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -I/usr/local/include/eventlog       -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -fast -xautopar -c -o persist-state.lo persist-state.c
libtool: compile:  cc -xc99=all -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/eventlog -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast -xautopar -c persist-state.c  -KPIC -DPIC -o .libs/persist-state.o
"persist-state.c", line 40: warning: anonymous struct declaration
"persist-state.c", line 38: warning: anonymous union declaration
"persist-state.c", line 194: improper member use: magic
"persist-state.c", line 211: improper member use: initial_key_store
"persist-state.c", line 213: improper member use: initial_key_store
"persist-state.c", line 326: warning: pointer to void or function used in arithmetic
"persist-state.c", line 346: warning: argument mismatch
"persist-state.c", line 352: warning: pointer to void or function used in arithmetic
"persist-state.c", line 382: improper member use: key_count
"persist-state.c", line 382: improper member use: key_count
"persist-state.c", line 389: warning: statement not reached
"persist-state.c", line 421: warning: pointer to void or function used in arithmetic
"persist-state.c", line 476: improper member use: initial_key_store
"persist-state.c", line 477: improper member use: initial_key_store
"persist-state.c", line 479: improper member use: key_count
"persist-state.c", line 493: warning: argument mismatch
"persist-state.c", line 508: warning: argument mismatch
"persist-state.c", line 533: warning: argument mismatch
"persist-state.c", line 569: warning: argument mismatch
"persist-state.c", line 598: warning: argument mismatch
cc: acomp failed for persist-state.c
gmake[3]: *** [persist-state.lo] Error 1
gmake[3]: Leaving directory `/home/soft/syslog-ng/syslog-ng-3.2.4/lib'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/soft/syslog-ng/syslog-ng-3.2.4/lib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/soft/syslog-ng/syslog-ng-3.2.4'
gmake: *** [all] Error 2

I tu już nie mam na razie pomysłu jak zwalczyć ten problem, a nie lubię i nie chcę za dużo dłubać w kodzie programu. Wersja 3.3.0beta1 i poprzednie wersje z serii 3.2.x również nie chcą się skompilować i widać, że kompilacja na Solarisie i przy użyciu Sun Studio będzie coraz trudniejsza. Wersji 3.1.3 i 3.1.4 nie da się ściągnąć w postaci źródłowej, pozostaje mi więc wrócić do 3.1.2, ale o tym osobny dokument.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.