1
0
Fork 0

Fix logrotate configuration (#4212)

This commit is contained in:
Wilfried Goesgens 2018-02-19 17:08:39 +01:00 committed by Jan
parent b3556f7b17
commit 5b58156309
4 changed files with 28 additions and 21 deletions

View File

@ -3,8 +3,8 @@
weekly
compress
delaycompress
create 640 arangodb adm
create 640 arangodb @LOGROTATE_GROUP@
postrotate
systemctl -q is-active @SERVICE_NAME@ && systemctl kill --signal=SIGHUP arangodb3
systemctl -q is-active @SERVICE_NAME@ && systemctl kill --signal=SIGHUP @SERVICE_NAME@
endscript
}

View File

@ -178,27 +178,8 @@ if (UNIX)
DESTINATION ${SYSTEMD_UNIT_DIR}/
RENAME ${SERVICE_NAME}.service
)
# configure and install logrotate file
configure_file (
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.systemd
${PROJECT_BINARY_DIR}/arangod.systemd
NEWLINE_STYLE UNIX
)
install(
FILES ${PROJECT_BINARY_DIR}/arangod.systemd
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d
RENAME ${SERVICE_NAME}
)
else ()
message(STATUS "-- systemd not found")
configure_file (
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.sysv
${PROJECT_BINARY_DIR}/arangod.sysv
NEWLINE_STYLE UNIX
)
endif(SYSTEMD_FOUND)
endif(NOT PKG_CONFIG_FOUND)
endif(UNIX)

View File

@ -24,6 +24,8 @@ else()
set(CPACK_SYSTEMD_FOUND "0")
endif()
set(LOGROTATE_GROUP "adm")
# substitute the package name so debconf works:
configure_file (
"${PROJECT_SOURCE_DIR}/Installation/debian/templates.in"

View File

@ -28,6 +28,7 @@ endif ()
set(ARANGODB_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
# eventually the package string will be modified later on:
set(LOGROTATE_GROUP "arangodb")
if ("${PACKAGING}" STREQUAL "DEB")
if(CMAKE_TARGET_ARCHITECTURES MATCHES ".*x86_64.*")
set(ARANGODB_PACKAGE_ARCHITECTURE "amd64")
@ -77,6 +78,29 @@ else ()
include(packages/tar)
endif ()
if (UNIX)
if (SYSTEMD_FOUND)
# configure and install logrotate file
configure_file (
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.systemd
${PROJECT_BINARY_DIR}/arangod.systemd
NEWLINE_STYLE UNIX
)
install(
FILES ${PROJECT_BINARY_DIR}/arangod.systemd
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d
RENAME ${SERVICE_NAME}
)
else ()
configure_file (
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.sysv
${PROJECT_BINARY_DIR}/arangod.sysv
NEWLINE_STYLE UNIX
)
endif ()
endif ()
configure_file(
"${CMAKE_SOURCE_DIR}/Installation/cmake/CMakeCPackOptions.cmake.in"