Closed jamesspi closed 5 years ago
Hi @jamesspi,
I think that your problem is not related to inotify: that file collects the agent information, adds some random data and sends it to the manager, so the issue may be related to any of these functions.
Please send us the error that the compiler reports about the problem, maybe it includes the line of code when the problem happens.
Thanks for your feedback. Best.
Hi @vikman90 ,
Thanks for the prompt response.
That is the only error I get unfortunately. Nothing else is reported.
Thanks, James
Hi - I might be able to help. I have built OSSEC several dozen times on AIX and several versions, ranging from 5.x to 7.x. Can you provide the compile output from the make through the error?
Hi @rnbwkat @vikman90 , here is the output:
Para instalação em português, escolha [br]. 要使用中文进行安装, 请选择 [cn]. Für eine deutsche Installation, wählen Sie [de]. Για εγκατάσταση στα Ελληνικά, επιλέξτε [el]. For installation in English, choose [en]. Para instalar en español, elija [es]. Pour une installation en français, choisissez [fr] A Magyar nyelvű telepítéshez válassza [hu]. Per l'installazione in Italiano, scegli [it]. 日本語でインストールします.選択して下さい.[jp]. Voor installatie in het Nederlands, kies [nl]. Aby instalować w języku Polskim, wybierz [pl]. Для инструкций по установке на русском ,введите [ru]. Za instalaciju na srpskom, izaberi [sr]. ** Türkçe kurulum için seçin [tr]. (en/br/cn/de/el/es/fr/hu/it/jp/nl/pl/ru/sr/tr) [en]: Wazuh v2.0.1 Installation Script - http://www.wazuh.com
You are about to start the installation process of Wazuh. You must have a C compiler pre-installed in your system.
Host: xxxxxxxxx
-- Press ENTER to continue or Ctrl-C to abort. --
1- What kind of installation do you want (server, agent, local, hybrid or help)? agent
2- Setting up the installation environment.
Choose where to install Wazuh [/var/ossec]:
3- Configuring Wazuh.
3.1- What's the IP Address or hostname of the Wazuh server?: xxxxxxxxxxxx
Adding Server IP
3.2- Do you want to run the integrity check daemon? (y/n) [y]:
Running syscheck (integrity check daemon).
3.3- Do you want to run the rootkit detection engine? (y/n) [y]:
Running rootcheck (rootkit detection).
3.4- Do you want to run policy monitoring checks? (OpenSCAP) (y/n) [y]:
Running OpenSCAP (policy monitoring checks).
3.5 - Do you want to enable active response? (y/n) [y]:
3.6- Setting the configuration to analyze the following logs:
-- /var/ossec/logs/active-responses.log
--- Press ENTER to continue ---
4- Installing the system
Running the Makefile
CC external/cJSON/cJSON.o
LINK libcJSON.a
RANLIB libcJSON.a
cd external/zlib-1.2.8/ && ./configure && make libz.a
Checking for shared library support...
Building shared library libz.so.1.2.8 with /usr/bin/gcc.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... No.
make[1]: Entering directory /install/soft/wazuh/wazuh-master/src/external/zlib-1.2.8' /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o adler32.o adler32.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o crc32.o crc32.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o deflate.o deflate.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o infback.o infback.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o inffast.o inffast.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o inflate.o inflate.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o inftrees.o inftrees.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o trees.o trees.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o zutil.o zutil.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o compress.o compress.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o uncompr.o uncompr.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o gzclose.o gzclose.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o gzlib.o gzlib.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o gzread.o gzread.c /usr/bin/gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o gzwrite.o gzwrite.c ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o make[1]: Leaving directory
/install/soft/wazuh/wazuh-master/src/external/zlib-1.2.8'
cd external/lua-5.2.3/ && make posix
make[1]: Entering directory /install/soft/wazuh/wazuh-master/src/external/lua-5.2.3' cd src && make posix make[2]: Entering directory
/install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src'
make all SYSCFLAGS="-DLUA_USE_POSIX"
make[3]: Entering directory /install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src' gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lapi.o lapi.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lcode.o lcode.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lctype.o lctype.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ldebug.o ldebug.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ldo.o ldo.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ldump.o ldump.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lfunc.o lfunc.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lgc.o lgc.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o llex.o llex.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lmem.o lmem.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lobject.o lobject.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lopcodes.o lopcodes.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lparser.o lparser.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lstate.o lstate.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lstring.o lstring.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ltable.o ltable.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ltm.o ltm.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lundump.o lundump.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lvm.o lvm.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lzio.o lzio.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lauxlib.o lauxlib.c lauxlib.c: In function 'skipBOM': lauxlib.c:601:9: warning: value computed is not used [-Wunused-value] lauxlib.c:606:10: warning: value computed is not used [-Wunused-value] lauxlib.c: In function 'skipcomment': lauxlib.c:621:11: warning: value computed is not used [-Wunused-value] lauxlib.c:623:11: warning: value computed is not used [-Wunused-value] gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lbaselib.o lbaselib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lbitlib.o lbitlib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lcorolib.o lcorolib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ldblib.o ldblib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o liolib.o liolib.c liolib.c: In function 'test_eof': liolib.c:364:11: warning: value computed is not used [-Wunused-value] gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lmathlib.o lmathlib.c lmathlib.c: In function 'luaopen_math': lmathlib.c:275:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o loslib.o loslib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lstrlib.o lstrlib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o ltablib.o ltablib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o loadlib.o loadlib.c gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o linit.o linit.c ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o ranlib liblua.a gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o lua.o lua.c gcc -o ossec-lua lua.o liblua.a -lm gcc -O2 -Wall -DLUA_COMPAT_ALL -DPREFIX=\"/var/ossec\" -DLUA_USE_POSIX -c -o luac.o luac.c gcc -o ossec-luac luac.o liblua.a -lm make[3]: Leaving directory
/install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src'
make[2]: Leaving directory /install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src' make[1]: Leaving directory
/install/soft/wazuh/wazuh-master/src/external/lua-5.2.3'
CC client-agent/notify.o
In file included from client-agent/notify.c:10:0:
./headers/shared.h:46:23: fatal error: sys/mount.h: No such file or directory
compilation terminated.
make: *** [client-agent/notify.o] Error 1
Error 0x5. Building error. Unable to finish the installation.
Last question - gcc or native cc?
Hi @jamesspi @rnbwkat,
The error seems to be related with line https://github.com/wazuh/wazuh/blob/2.1/src/headers/shared.h#L46.
Maybe you could disable that inclusion for AIX:
#if defined(Linux) || defined(FreeBSD)
#include <sys/mount.h>
#endif
But it's possible that you also have to deal with files https://github.com/wazuh/wazuh/blob/2.1/src/headers/fs_op.h#L38 or https://github.com/wazuh/wazuh/blob/2.1/src/shared/fs_op.c#L39.
They both have the precompiler condition, so I think that you have not to modify them, but I have no AIX installation available right now in order to test it. Please try to make that modification.
Best regards.
The problem is directly related to gcc vs cc. Install gcc and if you need to: ln -s /usr/bin/gcc /usr/bin/cc
When you install gcc, it will bring over the required libraries which fixes the includes. You do not have to comment out any of the includes.
Hi @rnbwkat - thank you very much for the feed back, i'll confirm this for you.
@vikman90 - Thanks too. If @rnbwkat's suggestion doesn't work I'll give this a go.
@rnbwkat , doesn't this say gcc?
Building shared library libz.so.1.2.8 with /usr/bin/gcc.
My bad - it does. Not sure how you installed gcc. Using rpm? That normally includes all the needed libraries. I can't see what version, but I just ran a vanilla install on a 7.1 system and after using rpm to install gcc and libraries, works like a champ with no mods.
Here are some notes I took on how to install GCC and compile the agent. This worked on OSSEC 2.8.3, and OSSEC 2.9 and AIX 7.1:
Install GCC:
1.- Download necessary packages from: http://www.perzl.org/aix/index.php?n=Main.Gcc
2.-Install packages:
rpm -ivh gcc gcc-cpp libgcc gmp libmpc mpfr libstdc++
If it fails with "AIX-rpm dependency needed", update virtual package:
$ /usr/sbin/updtvpkg $ rpm -qa | grep -i aix
3.- Install GMAKE: http://www.perzl.org/aix/index.php?n=Main.Make
4.-Setting up the environment:
export CC=/usr/bin/gcc export LD_LIBRARY_PATH=/usr/lib
5.-Compiling agent (OSSEC 2.8.3):
$ /usr/local/bin/make setagent $ /usr/local/bin/make all
Change user shell in InstallAgent.sh for /bin/bash (/bin/false does not exist)
Run install.sh
For OSSEC 2.9.0:
Change line 56 for := in Makefile
$ /usr/local/bin/make TARGET=agent
Note: libcrypto version is lower than 1.0.1, meaning that agent-auth won't compile for this version. It works when compiling OSSEC 2.6 (then you can copy agent-auth binary)
Couple of things: 3 - try adding make to the rpm install. make is not needed to be made by hand. And the AIX version works. Perhaps not on 2.9 - that is something I need to check.
5 - do not change the shell. Just update security settings in the /etc/shells file to include /bin/false, which does exist. Or in AIX terms, you can change it to /bin/nologin which they use a lot. But making /bin/bash valid for the agent is dangerous.
I will download 2.9 and try again and give a report tomorrow. I have 3 AIX versions/servers running here, so let's have some fun. :-)
Hi @vikman90 ,
You were right, need to change
https://github.com/wazuh/wazuh/blob/2.1/src/headers/fs_op.h also:
In file included from ./headers/shared.h:190:0, from client-agent/notify.c:10: ./headers/fs_op.h:41:38: error: dereferencing pointer to incomplete type make: *** [client-agent/notify.o] Error 1
Could you assist in the adjustment that would need to be made please?
Thanks, James
Hi @jamesspi,
it seems that FreeBSD
or Linux
are defined by the environment. Please run this command:
/usr/bin/gcc -dM -E - < /dev/null
It will dump all definitions. Please tell us whether these definitions appear in the output:
FreeBSD
Linux
AIX
We need this information in order to write the proper condition.
Regards.
HI @vikman90,
This is the output:
Thanks, James
Hi,
I cannot find neither FreeBSD
nor Linux
. This is OK.
Which branch are you using?
If you are using branch master or stable, this problem should be fixed by changing line https://github.com/wazuh/wazuh-dev/blob/master/src/headers/fs_op.h#L39:
#else
for:
#elif defined(Linux) || defined(FreeBSD)
If you are using branch 2.0 or 2.1 (that I don't recommend you to use because they are development branches) they should have this patch already. If the problem persists, please try to change line https://github.com/wazuh/wazuh-dev/blob/2.0/src/headers/fs_op.h#L38:
#elif !defined(WIN32) && (defined(Linux) || defined(FreeBSD))
for:
#elif !defined(WIN32) && (defined(Linux) || defined(FreeBSD)) && !defined(_AIX)
I hope this help you.
Best, Victor.
Thanks @vikman90 will give this a go.
Hi @vikman90 ,
I now get:
Para instalação em português, escolha [br]. 要使用中文进行安装, 请选择 [cn]. Für eine deutsche Installation, wählen Sie [de]. Για εγκατάσταση στα Ελληνικά, επιλέξτε [el]. For installation in English, choose [en]. Para instalar en español, elija [es]. Pour une installation en français, choisissez [fr] A Magyar nyelvű telepítéshez válassza [hu]. Per l'installazione in Italiano, scegli [it]. 日本語でインストールします.選択して下さい.[jp]. Voor installatie in het Nederlands, kies [nl]. Aby instalować w języku Polskim, wybierz [pl]. Для инструкций по установке на русском ,введите [ru]. Za instalaciju na srpskom, izaberi [sr]. ** Türkçe kurulum için seçin [tr]. (en/br/cn/de/el/es/fr/hu/it/jp/nl/pl/ru/sr/tr) [en]:
[H[2J Wazuh v2.0.1 Installation Script - http://www.wazuh.com
You are about to start the installation process of Wazuh. You must have a C compiler pre-installed in your system.
Host: uktedev01
-- Press ENTER to continue or Ctrl-C to abort. --
1- What kind of installation do you want (server, agent, local, hybrid or help)?
2- Setting up the installation environment.
Choose where to install Wazuh [/var/ossec]:
3- Configuring Wazuh.
3.1- What's the IP Address or hostname of the Wazuh server?:
Adding Server IP
3.2- Do you want to run the integrity check daemon? (y/n) [y]:
Running syscheck (integrity check daemon).
3.3- Do you want to run the rootkit detection engine? (y/n) [y]:
Running rootcheck (rootkit detection).
3.4- Do you want to run policy monitoring checks? (OpenSCAP) (y/n) [y]:
Running OpenSCAP (policy monitoring checks).
3.5 - Do you want to enable active response? (y/n) [y]:
3.6- Setting the configuration to analyze the following logs:
-- /var/ossec/logs/active-responses.log
--- Press ENTER to continue ---
4- Installing the system
Running the Makefile
cd external/lua-5.2.3/ && make posix
make[1]: Entering directory /install/soft/wazuh/wazuh-master/src/external/lua-5.2.3' cd src && make posix make[2]: Entering directory
/install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src'
make all SYSCFLAGS="-DLUA_USE_POSIX"
make[3]: Entering directory /install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src' make[3]: Nothing to be done for
all'.
make[3]: Leaving directory /install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src' make[2]: Leaving directory
/install/soft/wazuh/wazuh-master/src/external/lua-5.2.3/src'
make[1]: Leaving directory `/install/soft/wazuh/wazuh-master/src/external/lua-5.2.3'
[34mCC[0m [33mclient-agent/notify.o[0m
[34mCC[0m [33mclient-agent/start_agent.o[0m
[34mCC[0m [33mclient-agent/receiver.o[0m
[34mCC[0m [33mclient-agent/main.o[0m
[34mCC[0m [33mclient-agent/receiver-win.o[0m
[34mCC[0m [33mclient-agent/event-forward.o[0m
[34mCC[0m [33mclient-agent/agentd.o[0m
[34mCC[0m [33mclient-agent/intcheck_op.o[0m
[34mCC[0m [33mclient-agent/config.o[0m
[34mCC[0m [33mclient-agent/sendmsg.o[0m
[34mCC[0m [33mconfig/wmodules-config.o[0m
[34mCC[0m [33mconfig/csyslogd-config.o[0m
[34mCC[0m [33mconfig/alerts-config.o[0m
[34mCC[0m [33mconfig/syscheck-config.o[0m
[34mCC[0m [33mconfig/dbd-config.o[0m
[34mCC[0m [33mconfig/rules-config.o[0m
[34mCC[0m [33mconfig/client-config.o[0m
[34mCC[0m [33mconfig/global-config.o[0m
[34mCC[0m [33mconfig/email-alerts-config.o[0m
[34mCC[0m [33mconfig/config.o[0m
[34mCC[0m [33mconfig/wmodules-oscap.o[0m
[34mCC[0m [33mconfig/reports-config.o[0m
[34mCC[0m [33mconfig/remote-config.o[0m
[34mCC[0m [33mconfig/integrator-config.o[0m
[34mCC[0m [33mconfig/active-response.o[0m
[34mCC[0m [33mconfig/agentlessd-config.o[0m
[34mCC[0m [33mconfig/rootcheck-config.o[0m
[34mCC[0m [33mconfig/localfile-config.o[0m
[34;1mLINK[0m [37;1mconfig.a[0m
[34;1mRANLIB[0m [37;1mconfig.a[0m
[34mCC[0m [33mwazuh_modules/wm_oscap.o[0m
[34mCC[0m [33mwazuh_modules/wm_database.o[0m
[34mCC[0m [33mwazuh_modules/wm_exec.o[0m
[34mCC[0m [33mwazuh_modules/wmodules.o[0m
[34;1mLINK[0m [37;1mwmodules.a[0m
[34;1mRANLIB[0m [37;1mwmodules.a[0m
[34mCC[0m [33mos_crypto/blowfish/bf_op.o[0m
[34mCC[0m [33mos_crypto/blowfish/bf_skey.o[0m
[34mCC[0m [33mos_crypto/blowfish/bf_enc.o[0m
[34mCC[0m [33mos_crypto/md5/md5.o[0m
[34mCC[0m [33mos_crypto/md5/md5_op.o[0m
[34mCC[0m [33mos_crypto/sha1/sha1_op.o[0m
In file included from /usr/include/sys/localedef.h:43:0,
from /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.6.3/include-fixed/stdlib.h:594,
from os_crypto/sha1/sha_locl.h:63,
from os_crypto/sha1/sha1_op.c:26:
/usr/include/sys/lc_core.h:58:2: error: expected identifier or '(' before string constant
make: *** [os_crypto/sha1/sha1_op.o] Error 1
Error 0x5. Building error. Unable to finish the installation.
Hi @vikman90,
Have you had a chance to look at my previous comment by any chance?
Thanks.
Anyone?
Hi @jamesspi,
I got an AIX 6.1 installation and will try to reproduce the issue ASAP.
Regards, Victor.
Thank you @vikman90, appreciate it!
@jamesspi we did it!
I had to make some changes in the code:
Restrict mounth.h
to be included only for Linux and FreeBSD: https://github.com/wazuh/wazuh/commit/b014254e26f488fb5243389be169735244c9a098.
Prevent struct statfs
from being used on other systems than Linux or FreeBSD: https://github.com/wazuh/wazuh/commit/eaec6be279c2ff2e6959deb6bac7e45e02abf452#diff-913ffcf195b8fe8cb27eb88ea08bdbe9R40. You already fixed it, and it's fixed in branch 2.0
I got an error close to the one that you have, and it seems to be caused by the definition of __version
. It should be refactored: https://github.com/wazuh/wazuh/commit/8faf377980b81945bef12624be00076939e07ca4
The code was compiled with no pthread
option, and it should be added: https://github.com/wazuh/wazuh/commit/a3b77431c501006c789105e0a6a2b9af22dd8d15
AIX defines the type name label_t
, and Authd re-defines it. The type name (but not the structure) is superfluous and may be removed: https://github.com/wazuh/wazuh/commit/1954d083436dfa3745ef0f0a36f63bffd6185548
(Only to compile the manager) Monitord uses getopt.h
to parse a long option, --no-agents
. It may be replaced for -n
and this way we may remove the troubling inclusion: https://github.com/wazuh/wazuh/commit/8e5897151ac1b45c92ed61caad65631edbd02d11
All this commits have been made in branch 2.0. I've compiled it on AIX 6.1 with GCC 4.9.3.
I hope this solve your problem.
Best regards, Victor.
@vikman90 fantastic, thank you so much! I will give this a go.
Hi @vikman90,
Just to let you know that compilation worked :)
I had to make two changes to the src/init/adduser.sh script though:
Replace /usr/sbin/mkgroup with /usr/bin/mkgroup Reflect the useradd options to be the same as SunOS.
I have asked my AIX engineer to try again, hopefully this is all that's left.
Thanks again, James
@vikman90 - I forgot to mention that I also got this make: *** [install-common] Error 127
All error lines looked like:
./init/adduser.sh ossec ossecm ossecr ossec /var/ossec Wait for success... ./init/adduser.sh[61]: /usr/sbin/mkgroup: not found make: *** [install-common] Error 127 chown: ossec is an unknown groupname. ln: No such file or directory
I adjusted the mkgroup path and adduser options - just to make sure, is there something else that would cause make to fail?
Thanks, James
Hi @jamesspi,
you are right, we had a problem with useradd
on Solaris some days before. Thanks for notice us, if you have any other problem, let me know and I will try to get an AIX system again to test it.
Regards.
Hi @vikman90 ,
I can confirm the useradd and mkgroup changes work, but now - it seems that the AIX version of /usr/bin/install accepts different arguments:
install -d -m 0750 -o root -g ossec /var/ossec/ /usr/bin/getopt: illegal option -- d Usage: install [-c dira] [-f dirb] [-i] [-m] [-M mode] [-O owner] [-G group] [-S] [-n dirc] [-o] [-s] file [dirx ...] make: *** [install-common] Error 2
I guess I would have to change all instances of install in the Makefile, correct? I don't see a clause in there for an AIX uname.
Thanks, James
Hi,
please take a look to this commit: https://github.com/wazuh/wazuh/commit/bf7d3f486a6a3f31314ffac000f7e4b07221facf
We found a close (maybe the same) problem on Solaris and changed install
for ginstall
. Maybe AIX has also ginstall
and could be solved in the same way.
Regards.
Hi @vikman90,
Don't think so - there is installbsd, but parameters are different still.
Thanks, James
Hi all,
@vikman90 ginstall
is part of the coreutils package on Solaris and is needed to compile wazuh on Solaris properly. The native gcc
and make
and install
are not the same gnu-tools that are used on Linux systems. They behave absurdly differently and only work with Solaris-native packages.... The coreutils package is a 3rd party package and provides all different gnu-tools... https://www.opencsw.org/search/coreutils/
cheers, theresa
Hi @jamesspi and @aremai,
thank you for your clarification! It fails for create directories and I guess that it will also fail for files (-m
becomes -M
and -o
becomes -O
). Long time ago the installation procedure was made by a script (instead of Makefile).
I think that taking installation back to a script would make easier to fix this problem. We had this idea in mind for another project. I will discuss about it with the development team and we will propose a solution.
In the meantime, ideas are welcome!
Best regards, Victor.
Hi,
I'm looking to compile this on AIX, but I'm getting this error on compilation:
make: *** [client-agent/notify.o] Error 1
Looks like it's related to inotify - but this doesn't seem to be available for AIX.
Any suggestions please?
Thanks, James