mirror of
https://github.com/pavel-odintsov/fastnetmon
synced 2024-05-10 00:16:25 +02:00
Compare commits
3 Commits
806a5533ed
...
65f06e7b7d
Author | SHA1 | Date | |
---|---|---|---|
Michael Cho | 65f06e7b7d | ||
Pavel Odintsov | dfc161008a | ||
Michael Cho | fad8757b89 |
|
@ -594,26 +594,26 @@ if (ENABLE_GOBGP_SUPPORT)
|
|||
target_link_libraries(gobgp_action absl::base absl::synchronization)
|
||||
endif()
|
||||
|
||||
# By default use module supplied by cmake to search for Protobuf
|
||||
set(FIND_PACKAGE_MODE_PROTOBUF "MODULE")
|
||||
|
||||
if (DO_NOT_USE_SYSTEM_LIBRARIES_FOR_BUILD)
|
||||
# We add our custom path to Protobuf to top of search_list used by find_package: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
|
||||
# This approach has advantage over Protobuf_DIR which requires us to set direct path to cmake folder of custom built dependency
|
||||
# which resides in vendor specific folder with name lib which may be lib64 on CentOS platforms:
|
||||
# protobuf_21_12/lib/cmake/protobuf or protobuf_21_12/lib64/cmake/protobuf on CentOS
|
||||
list(APPEND CMAKE_PREFIX_PATH ${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH})
|
||||
|
||||
# Switch to use to configuration supplied by custom Protobuf installation as it may be better
|
||||
set(FIND_PACKAGE_MODE_PROTOBUF "CONFIG")
|
||||
|
||||
# Apparently it's required to set this flag because without this flag set it cannot find protoc when custom library path is in use
|
||||
# https://github.com/protocolbuffers/protobuf/issues/1931
|
||||
set(protobuf_MODULE_COMPATIBLE true)
|
||||
endif()
|
||||
|
||||
# https://cmake.org/cmake/help/latest/module/FindProtobuf.html
|
||||
find_package(Protobuf ${FIND_PACKAGE_MODE_PROTOBUF} REQUIRED)
|
||||
# Apparently it's required to set this flag because without this flag set it cannot find protoc when custom library path is in use
|
||||
# https://github.com/protocolbuffers/protobuf/issues/1931
|
||||
set(protobuf_MODULE_COMPATIBLE true)
|
||||
|
||||
# Switch to use to configuration supplied by custom Protobuf installation as it may be better
|
||||
find_package(Protobuf CONFIG)
|
||||
|
||||
if (NOT Protobuf_FOUND)
|
||||
# Fall back to module supplied by cmake to search for Protobuf
|
||||
# https://cmake.org/cmake/help/latest/module/FindProtobuf.html
|
||||
find_package(Protobuf MODULE REQUIRED)
|
||||
endif()
|
||||
|
||||
if (Protobuf_FOUND)
|
||||
message(STATUS "Found Protobuf ${Protobuf_VERSION}")
|
||||
|
|
|
@ -5,10 +5,14 @@ After=network.target remote-fs.target
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=@CMAKE_INSTALL_SBINDIR@/fastnetmon
|
||||
ExecStart=@CMAKE_INSTALL_SBINDIR@/fastnetmon --log_to_console
|
||||
User=fastnetmon
|
||||
Group=fastnetmon
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
LimitNOFILE=65535
|
||||
|
||||
# We need it to use AF_PACKET and AF_XDP when run under non root user
|
||||
AmbientCapabilities=CAP_NET_RAW CAP_IPC_LOCK
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -11,7 +11,7 @@ Group=fastnetmon
|
|||
Restart=on-failure
|
||||
RestartSec=3
|
||||
LimitNOFILE=65535
|
||||
# We need it to use AF_PACKET when run under non root user
|
||||
# We need it to use AF_PACKET and AF_XDP when run under non root user
|
||||
AmbientCapabilities=CAP_NET_RAW CAP_IPC_LOCK
|
||||
|
||||
[Install]
|
||||
|
|
Loading…
Reference in New Issue