1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-11-29 21:32:24 +01:00

Removed ldconfig changes, added conf option flag, added FNM run on CI after build

This commit is contained in:
Pavel Odintsov 2022-02-09 14:27:32 +00:00
parent 1b2fe874ae
commit 25e64d486a
3 changed files with 21 additions and 34 deletions

@ -22,7 +22,8 @@ jobs:
key: ubuntu2004_dependencies_25_05_2020
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
ubuntu1804:
docker:
- image: ubuntu:bionic-20200403
@ -46,6 +47,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
ubuntu1604:
docker:
- image: ubuntu:xenial-20200326
@ -69,6 +71,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
debian9:
docker:
- image: debian:stretch-20200514
@ -92,6 +95,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
debian10:
docker:
- image: debian:buster-20200514
@ -115,6 +119,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
centos6:
docker:
- image: centos:centos6.9
@ -137,6 +142,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
centos7:
docker:
- image: centos:centos7.8.2003
@ -159,6 +165,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
centos8:
docker:
- image: centos:centos8.1.1911
@ -181,6 +188,7 @@ jobs:
paths:
- /opt
- run: cd src; mkdir -p build; cd build; cmake ..; make
- run: /opt/fastnetmon/fastnetmon --configuration_check
workflows:
version: 2
all_distros:

@ -2739,6 +2739,7 @@ void redirect_fds() {
int main(int argc, char** argv) {
bool daemonize = false;
bool only_configuration_check = false;
namespace po = boost::program_options;
@ -2749,6 +2750,7 @@ int main(int argc, char** argv) {
("help", "produce help message")
("version", "show version")
("daemonize", "detach from the terminal")
("configuration_check", "check configuration and exit")
("configuration_file", po::value<std::string>(),"set path to custom configuration file")
("log_file", po::value<std::string>(), "set path to custom log file");
// clang-format on
@ -2771,6 +2773,10 @@ int main(int argc, char** argv) {
daemonize = true;
}
if (vm.count("configuration_check")) {
only_configuration_check = true;
}
if (vm.count("configuration_file")) {
global_config_path = vm["configuration_file"].as<std::string>();
std::cout << "We will use custom path to configuration file: " << global_config_path << std::endl;
@ -2832,6 +2838,11 @@ int main(int argc, char** argv) {
exit(1);
}
if (only_configuration_check) {
logger << log4cpp::Priority::INFO << "Configuration file is correct. Shutdown toolkit";
exit(0);
}
if (file_exists(pid_path)) {
pid_t pid_from_file = 0;

@ -601,8 +601,6 @@ sub install_luajit {
} else {
exec_command("make $make_options install");
}
put_library_path_to_ld_so("/etc/ld.so.conf.d/luajit.conf", "/opt/luajit_2.0.4/lib");
}
sub install_luajit_libs {
@ -680,8 +678,6 @@ sub install_json_c {
print "Install it\n";
exec_command("make $make_options install");
put_library_path_to_ld_so("/etc/ld.so.conf.d/json-c.conf", "$install_path/lib");
}
sub install_lua_json {
@ -827,9 +823,6 @@ sub install_log4cpp {
}
exec_command("make $make_options install");
print "Add log4cpp to ld.so.conf\n";
put_library_path_to_ld_so("/etc/ld.so.conf.d/log4cpp.conf", "$log4cpp_install_path/lib");
}
sub install_grpc_dependencies {
@ -866,7 +859,7 @@ sub install_grpc {
my $make_result = exec_command("make $make_options");
unless ($make_result) {
die "Could not build gRPC: make failed";
die "Could not build gRPC: make failed\n";
}
print "Install gRPC\n";
@ -1011,9 +1004,6 @@ sub install_hiredis {
print "Build hiredis\n";
chdir "hiredis-0.13.1";
exec_command("PREFIX=$hiredis_install_path make $make_options install");
print "Add hiredis to ld.so.conf\n";
put_library_path_to_ld_so("/etc/ld.so.conf.d/hiredis.conf", "$hiredis_install_path/lib");
}
# We use global variable $ndpi_repository here
@ -1062,9 +1052,6 @@ sub install_ndpi {
print "Build and install nDPI\n";
exec_command("make $make_options install");
print "Add ndpi to ld.so.conf\n";
put_library_path_to_ld_so("/etc/ld.so.conf.d/ndpi.conf", "/opt/ndpi/lib");
}
sub init_package_manager {
@ -1079,20 +1066,6 @@ sub init_package_manager {
}
}
sub put_library_path_to_ld_so {
my ($ld_so_file_path, $library_path) = @_;
if ($os_type eq 'macosx' or $os_type eq 'freebsd') {
return;
}
open my $ld_so_conf_handle, ">", $ld_so_file_path or fast_die("Can't open file $ld_so_file_path $! for writing");
print {$ld_so_conf_handle} $library_path;
close $ld_so_conf_handle;
exec_command("ldconfig");
}
sub read_file {
my $file_name = shift;
@ -1367,11 +1340,6 @@ sub install_pf_ring {
exec_command("./configure --prefix=$pf_ring_install_path");
exec_command("make $make_options");
exec_command("make $make_options install");
print "Create library symlink\n";
print "Add pf_ring to ld.so.conf\n";
put_library_path_to_ld_so("/etc/ld.so.conf.d/pf_ring.conf", "$pf_ring_install_path/lib");
}
sub apt_get {