I am trying to get started with Suricata, and eventually be able to contribute. However, I get a cbindgen error while installing even though I already have all Rust dependencies installed.
I have attached the config.log files and the error logs(both as a screenshot and a link) as I am unsure which is the preferred way for posting error logs. Please let me know so I can do it the right way the next time.
Are you doing the ./configure and make as a user, then doing sudo make install? If so, depending on your distribution, sudo -E make install might help.
Yes. I tried that too but it doesn’t seem to work. There seems to be problem with cbindgen(or my rust ecosystem maybe?). I tried uninstalling and reinstalling cbindgen but I get a spurious network error with cargo install rust.
This error /home/sumera/.cargo/registry/index/github.com-1ecc6299db9ec823/.git/FETCH_HEAD' is locked: Permission denied; is likely due to some files not being owned by you (did you use git as root?
So we have an issue where when using tools installed by Rustup, they are not seen under sudo. This is fixed in the 6.0 beta’s, but the workaround for now would be something like:
sudo chown -R user:user .
make
sudo env PATH=$PATH make install-full
Make sure to replace user with your username that is building Suricata. This should work in sudo environments that will never pass the PATH through like Fedora and CentOS.
Hi,
I was able to install cbindgen, thanks, @Jeff_Lucovsky !
However there still seems to be some problems with rustup. I followed the instructions but still get the error : “no override and no default toolchain set”.
Sure. I deleted Suricata and ran the following from scratch:
git clone https://github.com/OISF/suricata.git
cd suricata
./autogen.sh
./configure
sudo chown -R sumera:sumera .
make
I got a libhtp error here. So I installed that.
cd libhtp
./autogen.sh
./configure
make
sudo make install
cd ../
./configure
sudo chown -R sumera:sumera
make
I got a rules not installed as update rules not available error. I figured this might be because I didn’t use make clean.
make clean
sudo env PATH=$PATH make install-full
This led to the error I described previously; I tried troubleshooting with reinstalling and installing rustup again but that seems not to work either . :((
I am using Pop OS. Actually I tried it on a different Ubuntu Budgie laptop too but am getting the same error. Maybe I will just reinstall Rust and give it a shot.
So, I tried again and have a few doubts. This is what I tried though:
~/Elantris/suricata master ?1 sudo make install 2 Ń… base Py
Making install in libhtp
make[1]: Entering directory '/home/sumera/Elantris/suricata/libhtp'
Making install in htp
make[2]: Entering directory '/home/sumera/Elantris/suricata/libhtp/htp'
Making install in lzma
make[3]: Entering directory '/home/sumera/Elantris/suricata/libhtp/htp/lzma'
make[4]: Entering directory '/home/sumera/Elantris/suricata/libhtp/htp/lzma'
make[4]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/include/htp/lzma'
/usr/bin/install -c -m 644 LzmaDec.h 7zTypes.h '/usr/local/include/htp/lzma'
make[4]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/htp/lzma'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/htp/lzma'
make[3]: Entering directory '/home/sumera/Elantris/suricata/libhtp/htp'
make[4]: Entering directory '/home/sumera/Elantris/suricata/libhtp/htp'
/usr/bin/mkdir -p '/usr/local/lib'
/bin/bash ../libtool --mode=install /usr/bin/install -c libhtp.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libhtp.so.2.0.0 /usr/local/lib/libhtp.so.2.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libhtp.so.2.0.0 libhtp.so.2 || { rm -f libhtp.so.2 && ln -s libhtp.so.2.0.0 libhtp.so.2; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libhtp.so.2.0.0 libhtp.so || { rm -f libhtp.so && ln -s libhtp.so.2.0.0 libhtp.so; }; })
libtool: install: /usr/bin/install -c .libs/libhtp.lai /usr/local/lib/libhtp.la
libtool: install: /usr/bin/install -c .libs/libhtp.a /usr/local/lib/libhtp.a
libtool: install: chmod 644 /usr/local/lib/libhtp.a
libtool: install: ranlib /usr/local/lib/libhtp.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/usr/local/include/htp'
/usr/bin/install -c -m 644 bstr.h bstr_builder.h htp.h htp_base64.h htp_config.h htp_connection_parser.h htp_core.h htp_decompressors.h htp_hooks.h htp_list.h htp_multipart.h htp_table.h htp_transaction.h htp_urlencoded.h htp_utf8_decoder.h htp_version.h '/usr/local/include/htp'
make[4]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/htp'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/htp'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/htp'
Making install in test
make[2]: Entering directory '/home/sumera/Elantris/suricata/libhtp/test'
make[3]: Entering directory '/home/sumera/Elantris/suricata/libhtp/test'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/test'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/test'
Making install in docs
make[2]: Entering directory '/home/sumera/Elantris/suricata/libhtp/docs'
make[3]: Entering directory '/home/sumera/Elantris/suricata/libhtp/docs'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/docs'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/libhtp/docs'
make[2]: Entering directory '/home/sumera/Elantris/suricata/libhtp'
make[3]: Entering directory '/home/sumera/Elantris/suricata/libhtp'
make[3]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 htp.pc '/usr/local/lib/pkgconfig'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/libhtp'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/libhtp'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/libhtp'
Making install in rust
make[1]: Entering directory '/home/sumera/Elantris/suricata/rust'
RUSTUP_HOME=/home/sumera/.rustup \
CARGO_HOME="/home/sumera/.cargo" \
CARGO_TARGET_DIR="/home/sumera/Elantris/suricata/rust/target" \
/home/sumera/.cargo/bin/cargo build --release \
--features "function-macro "
Finished release [optimized + debuginfo] target(s) in 0.03s
make gen/rust-bindings.h
make[2]: Entering directory '/home/sumera/Elantris/suricata/rust'
make[2]: 'gen/rust-bindings.h' is up to date.
make[2]: Leaving directory '/home/sumera/Elantris/suricata/rust'
make[2]: Entering directory '/home/sumera/Elantris/suricata/rust'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/sumera/Elantris/suricata/rust'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/rust'
Making install in src
make[1]: Entering directory '/home/sumera/Elantris/suricata/src'
make[2]: Entering directory '/home/sumera/Elantris/suricata/src'
/usr/bin/mkdir -p '/usr/local/bin'
/bin/bash ../libtool --mode=install /usr/bin/install -c suricata '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/suricata /usr/local/bin/suricata
/usr/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 suricata-plugin.h '/usr/local/include'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/src'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/src'
Making install in qa
make[1]: Entering directory '/home/sumera/Elantris/suricata/qa'
Making install in coccinelle
make[2]: Entering directory '/home/sumera/Elantris/suricata/qa/coccinelle'
make[3]: Entering directory '/home/sumera/Elantris/suricata/qa/coccinelle'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/qa/coccinelle'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/qa/coccinelle'
make[2]: Entering directory '/home/sumera/Elantris/suricata/qa'
make[3]: Entering directory '/home/sumera/Elantris/suricata/qa'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/qa'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/qa'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/qa'
Making install in rules
make[1]: Entering directory '/home/sumera/Elantris/suricata/rules'
make[2]: Entering directory '/home/sumera/Elantris/suricata/rules'
make[2]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/share/suricata/rules'
/usr/bin/install -c -m 644 app-layer-events.rules decoder-events.rules dhcp-events.rules dnp3-events.rules dns-events.rules files.rules http-events.rules ipsec-events.rules kerberos-events.rules modbus-events.rules nfs-events.rules ntp-events.rules smb-events.rules smtp-events.rules stream-events.rules tls-events.rules '/usr/local/share/suricata/rules'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/rules'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/rules'
Making install in doc
make[1]: Entering directory '/home/sumera/Elantris/suricata/doc'
Making install in userguide
make[2]: Entering directory '/home/sumera/Elantris/suricata/doc/userguide'
make[3]: Entering directory '/home/sumera/Elantris/suricata/doc/userguide'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/doc/userguide'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/doc/userguide'
Making install in devguide
make[2]: Entering directory '/home/sumera/Elantris/suricata/doc/devguide'
make[3]: Entering directory '/home/sumera/Elantris/suricata/doc/devguide'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/doc/devguide'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/doc/devguide'
make[2]: Entering directory '/home/sumera/Elantris/suricata/doc'
make[3]: Entering directory '/home/sumera/Elantris/suricata/doc'
make[3]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/share/doc/suricata'
/usr/bin/install -c -m 644 AUTHORS GITGUIDE INSTALL NEWS README TODO INSTALL.PF_RING INSTALL.WINDOWS Basic_Setup.txt Setting_up_IPSinline_for_Linux.txt Third_Party_Installation_Guides.txt '/usr/local/share/doc/suricata'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/doc'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/doc'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/doc'
Making install in contrib
make[1]: Entering directory '/home/sumera/Elantris/suricata/contrib'
Making install in file_processor
make[2]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor'
Making install in Action
make[3]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor/Action'
make[4]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor/Action'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor/Action'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor/Action'
Making install in Processor
make[3]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor/Processor'
make[4]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor/Processor'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor/Processor'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor/Processor'
make[3]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor'
make[4]: Entering directory '/home/sumera/Elantris/suricata/contrib/file_processor'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor'
make[3]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/contrib/file_processor'
make[2]: Entering directory '/home/sumera/Elantris/suricata/contrib'
make[3]: Entering directory '/home/sumera/Elantris/suricata/contrib'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/sumera/Elantris/suricata/contrib'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/contrib'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/contrib'
Making install in etc
make[1]: Entering directory '/home/sumera/Elantris/suricata/etc'
make[2]: Entering directory '/home/sumera/Elantris/suricata/etc'
make[2]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/share/suricata'
/usr/bin/install -c -m 644 classification.config reference.config '/usr/local/share/suricata'
make[2]: Leaving directory '/home/sumera/Elantris/suricata/etc'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/etc'
Making install in python
make[1]: Entering directory '/home/sumera/Elantris/suricata/python'
cd . && \
/home/sumera/miniconda3/bin/python3 setup.py build --build-base "/home/sumera/Elantris/suricata/python"
running build
running build_py
running build_scripts
make[2]: Entering directory '/home/sumera/Elantris/suricata/python'
cd . && \
/home/sumera/miniconda3/bin/python3 setup.py build --build-base "/home/sumera/Elantris/suricata/python" \
install --prefix /usr/local
running build
running build_py
running build_scripts
running install
running install_lib
running install_scripts
changing mode of /usr/local/bin/suricatasc to 775
changing mode of /usr/local/bin/suricatactl to 775
running install_egg_info
Removing /usr/local/lib/python3.8/site-packages/suricata-6.0.0_dev-py3.8.egg-info
Writing /usr/local/lib/python3.8/site-packages/suricata-6.0.0_dev-py3.8.egg-info
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/sumera/Elantris/suricata/python'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/python'
Making install in ebpf
make[1]: Entering directory '/home/sumera/Elantris/suricata/ebpf'
make[2]: Entering directory '/home/sumera/Elantris/suricata/ebpf'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/sumera/Elantris/suricata/ebpf'
make[1]: Leaving directory '/home/sumera/Elantris/suricata/ebpf'
make[1]: Entering directory '/home/sumera/Elantris/suricata'
make[2]: Entering directory '/home/sumera/Elantris/suricata'
make[2]: Nothing to be done for 'install-exec-am'.
Run 'make install-conf' if you want to install initial configuration files. Or 'make install-full' to install configuration and rules
make[2]: Leaving directory '/home/sumera/Elantris/suricata'
make[1]: Leaving directory '/home/sumera/Elantris/suricata'
~/Elantris/suricata master ?1 sudo make install-conf âś” base Py
install -d "/usr/local/etc/suricata/"
install -d "/usr/local/var/log/suricata/files"
install -d "/usr/local/var/log/suricata/certs"
install -d "/usr/local/var/run/"
install -m 770 -d "/usr/local/var/run/suricata"
~/Elantris/suricata master ?1 sudo make install-rules âś” base Py
error: rules not installed as suricata-update not available
make: *** [Makefile:931: install-rules] Error 1
~/Elantris/suricata master ?1 ls suricata-update 2 Ń… base Py
Makefile.am Makefile.in
So, make install-conf works, but there is a problem with install-full as rules are unable to get installed. Is there a way to install the rules separately? I do see a rules folder in my suricata directory with the following contents:
Something else I noticed is that the suricata-update folder does not have a Makefile. My understanding is that automake uses Makefile.am to generate Makefile.in and configure uses Makefile.in to generate the Makefile. But ./configure does seem to run correctly on my pc.
What is going wrong here?
Nothing really wrong. Suricata when checked out from git does not include suricata-update, so you’ll need to bundle it yourself when building from a git checout. Our CI system uses a command like the following to bundle suricata-update:
Can you try ldconfig /usr/local/lib and see if that helps? Some Linux distributions need it, other’s don’t.
make install-conf (which is part of install-full) should have installed classification.config, etc along with suricata.yaml in /usr/local/etc/suricata.
I was able to solve this problem by installing suricata-update with pip3 and then moving the executable into /usr/bin/
Even though I was assuming make install-full would look in ~/.local/bin (which is on my PATH) where suricata-update gets placed.
Additionally, I had to modify the makefile - the file has these lines:
install-rules:
LD_LIBRARY_PATH=(libdir) (DESTDIR)(bindir)/suricata-update \
--suricata (DESTDIR)(bindir)/suricata \
--suricata-conf (DESTDIR)$(sysconfdir)/suricata/suricata.yaml
–no-test --no-reload
and they were commented out, so I took out the comments.