8000 Fix logrotate configuration (#4212) · ashang/arangodb@5b58156 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b58156

Browse files
dothebartjsteemann
authored andcommitted
Fix logrotate configuration (arangodb#4212)
1 parent b3556f7 commit 5b58156

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

Installation/logrotate.d/arangod.systemd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
weekly
44
compress
55
delaycompress
6-
create 640 arangodb adm
6+
create 640 arangodb @LOGROTATE_GROUP@
77
postrotate
8-
systemctl -q is-active @SERVICE_NAME@ && systemctl kill --signal=SIGHUP arangodb3
8+
systemctl -q is-active @SERVICE_NAME@ && systemctl kill --signal=SIGHUP @SERVICE_NAME@
99
endscript
1010
}

cmake/ArangoDBInstall.cmake

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,27 +178,8 @@ if (UNIX)
178178
DESTINATION ${SYSTEMD_UNIT_DIR}/
179179
RENAME ${SERVICE_NAME}.service
180180
)
181-
182-
# configure and install logrotate file
183-
configure_file (
184-
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.systemd
185-
${PROJECT_BINARY_DIR}/arangod.systemd
186-
NEWLINE_STYLE UNIX
187-
)
188-
install(
189-
FILES ${PROJECT_BINARY_DIR}/arangod.systemd
190-
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
191-
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d
192-
RENAME ${SERVICE_NAME}
193-
)
194-
195181
else ()
196182
message(STATUS "-- systemd not found")
197-
configure_file (
198-
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.sysv
199-
${PROJECT_BINARY_DIR}/arangod.sysv
200-
NEWLINE_STYLE UNIX
201-
)
202183
endif(SYSTEMD_FOUND)
203184
endif(NOT PKG_CONFIG_FOUND)
204185
endif(UNIX)

cmake/packages/deb.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ else()
2424
set(CPACK_SYSTEMD_FOUND "0")
2525
endif()
2626

27+
set(LOGROTATE_GROUP "adm")
28+
2729
# substitute the package name so debconf works:
2830
configure_file (
2931
"${PROJECT_SOURCE_DIR}/Installation/debian/templates.in"

cmake/packages/packages.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ endif ()
2828
set(ARANGODB_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
2929
# eventually the package string will be modified later on:
3030

31+
set(LOGROTATE_GROUP "arangodb")
3132
if ("${PACKAGING}" STREQUAL "DEB")
3233
if(CMAKE_TARGET_ARCHITECTURES MATCHES ".*x86_64.*")
3334
set(ARANGODB_PACKAGE_ARCHITECTURE "amd64")
@@ -77,6 +78,29 @@ else ()
7778
include(packages/tar)
7879
endif ()
7980

81+
if (UNIX)
82+
if (SYSTEMD_FOUND)
83+
# configure and install logrotate file
84+
configure_file (
85+
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.systemd
86+
${PROJECT_BINARY_DIR}/arangod.systemd
87+
NEWLINE_STYLE UNIX
88+
)
89+
install(
90+
FILES ${PROJECT_BINARY_DIR}/arangod.systemd
91+
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
92+
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d
93+
RENAME ${SERVICE_NAME}
94+
)
95+
else ()
96+
configure_file (
97+
${ARANGODB_SOURCE_DIR}/Installation/logrotate.d/arangod.sysv
98+
${PROJECT_BINARY_DIR}/arangod.sysv
99+
NEWLINE_STYLE UNIX
100+
)
101+
endif ()
102+
endif ()
103+
80104

81105
configure_file(
82106
"${CMAKE_SOURCE_DIR}/Installation/cmake/CM 378D akeCPackOptions.cmake.in"

0 commit comments

Comments
 (0)
0