Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1543,9 +1543,10 @@ if(DPKG_PROGRAM)
${PROJECT_SOURCE_DIR}/cpack/debian/conffiles
)

set(LDCONFIG_SCRIPT_CMDS "")
if(FLB_RUN_LDCONFIG)
set(LDCONFIG_DIR ${FLB_INSTALL_LIBDIR})
file(WRITE ${PROJECT_BINARY_DIR}/scripts/postinst "
set(LDCONFIG_SCRIPT_CMDS "
mkdir -p /etc/ld.so.conf.d
echo \"${LDCONFIG_DIR}\" > /etc/ld.so.conf.d/libfluent-bit.conf
ldconfig
Expand All @@ -1554,9 +1555,19 @@ ldconfig
rm -f -- /etc/ld.so.conf.d/libfluent-bit.conf
ldconfig
")
set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/scripts/postinst;${PROJECT_BINARY_DIR}/scripts/prerm")
list(APPEND CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/scripts/postinst;${PROJECT_BINARY_DIR}/scripts/prerm")
endif(FLB_RUN_LDCONFIG)

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cpack/debian/postinst.in"
"${PROJECT_BINARY_DIR}/scripts/postinst"
)
execute_process(
COMMAND "${CMAKE_COMMAND}" -E chmod +x
"${PROJECT_BINARY_DIR}/scripts/postinst"
)

list(APPEND CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/scripts/postinst")
endif()

# RPM Generation information
Expand Down
9 changes: 9 additions & 0 deletions cpack/debian/postinst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e
@LDCONFIG_SCRIPT_CMDS@
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
systemctl try-restart @[email protected] >/dev/null || true
fi
fi