Add logrotate configuration files.
Dorian Guillois
11 years ago
450 | 450 |
COMPONENT "runtime")
|
451 | 451 |
endif ()
|
452 | 452 |
|
|
453 |
# logrotate directory.
|
|
454 |
option(WITH_LOGROTATE_SCRIPT "Generate and install logrotate script." OFF)
|
|
455 |
if (WITH_LOGROTATE_SCRIPT)
|
|
456 |
# Generate logrotate file.
|
|
457 |
message(STATUS "Generating logrorate file.")
|
|
458 |
configure_file(
|
|
459 |
"${SCRIPT_DIR}/logrotate.conf.in"
|
|
460 |
"${SCRIPT_DIR}/logrotate.conf"
|
|
461 |
@ONLY)
|
|
462 |
|
|
463 |
# logrotate file install directory.
|
|
464 |
if (WITH_LOGROTATE_DIR)
|
|
465 |
set(LOGROTATE_DIR "${WITH_LOGROTATE_DIR}")
|
|
466 |
else ()
|
|
467 |
set(LOGROTATE_DIR "/etc/logrotate.d")
|
|
468 |
endif ()
|
|
469 |
|
|
470 |
# Install rule.
|
|
471 |
install(
|
|
472 |
FILES "${SCRIPT_DIR}/logrotate.conf"
|
|
473 |
DESTINATION "${LOGROTATE_DIR}"
|
|
474 |
COMPONENT "runtime"
|
|
475 |
RENAME "centengine"
|
|
476 |
)
|
|
477 |
endif ()
|
|
478 |
|
453 | 479 |
# var directory.
|
454 | 480 |
if (WITH_VAR_DIR)
|
455 | 481 |
set(VAR_DIR "${WITH_VAR_DIR}")
|
|
1121 | 1147 |
if (WITH_PKGCONFIG_SCRIPT)
|
1122 | 1148 |
message(STATUS " - pkg-config directory ${PKGCONFIG_DIR}")
|
1123 | 1149 |
endif ()
|
|
1150 |
if (WITH_LOGROTATE_SCRIPT)
|
|
1151 |
message(STATUS " - logrotate directory ${LOGROTATE_DIR}")
|
|
1152 |
endif ()
|
1124 | 1153 |
if (STARTUP_DIR)
|
1125 | 1154 |
message(STATUS " - Startup directory ${STARTUP_DIR}")
|
1126 | 1155 |
endif ()
|
|
0 |
@VAR_DIR@/centengine.log {
|
|
1 |
compress
|
|
2 |
copytruncate
|
|
3 |
create 640 @USER@ @GROUP@
|
|
4 |
daily
|
|
5 |
delaycompress
|
|
6 |
missingok
|
|
7 |
notifempty
|
|
8 |
olddir @LOG_ARCHIVE_DIR@
|
|
9 |
rotate 30
|
|
10 |
size 100M
|
|
11 |
}
|
|
12 |
|
|
13 |
@VAR_DIR@/centengine.debug {
|
|
14 |
compress
|
|
15 |
copytruncate
|
|
16 |
create 640 @USER@ @GROUP@
|
|
17 |
daily
|
|
18 |
delaycompress
|
|
19 |
missingok
|
|
20 |
notifempty
|
|
21 |
olddir @LOG_ARCHIVE_DIR@
|
|
22 |
rotate 5
|
|
23 |
size 1G
|
|
24 |
}
|