Ensure to copy all logrotate configuration files.

This commit is contained in:
Jeremy Gardais 2018-01-30 17:04:28 +01:00
parent e28c606751
commit d44d9436db
1 changed files with 7 additions and 13 deletions

View File

@ -5,14 +5,10 @@ RSYSLOGD_CONF_PATH="/etc/rsyslog.conf"
RSYSLOGD_INCLUDE_SRC="$(dirname $0)/stretch/etc/rsyslog.d/*"
RSYSLOGD_INCLUDE_PATH="/etc/rsyslog.d/"
LOGROTATE_CONF="$(dirname $0)/stretch/etc/logrotate.conf"
LOGROTATE_FILE="/etc/logrotate.conf"
LOGROTATE_SYSLOG_CONF="$(dirname $0)/stretch/etc/logrotate.d/rsyslog"
LOGROTATE_SYSLOG_FILE="/etc/logrotate.d/rsyslog"
LOGROTATE_APTITUDE_CONF="$(dirname $0)/stretch/etc/logrotate.d/aptitude"
LOGROTATE_APTITUDE_FILE="/etc/logrotate.d/aptitude"
LOGROTATE_DPKG_CONF="$(dirname $0)/stretch/etc/logrotate.d/dpkg"
LOGROTATE_DPKG_FILE="/etc/logrotate.d/dpkg"
LOGROTATE_CONF_SRC="$(dirname $0)/stretch/etc/logrotate.conf"
LOGROTATE_CONF_PATH="/etc/logrotate.conf"
LOGROTATE_INCLUDE_SRC="$(dirname $0)/stretch/etc/logrotate.d/*"
LOGROTATE_INCLUDE_PATH="/etc/logrotate.d/"
## Packages {{{
# Ensure to have some basic packages
@ -83,12 +79,10 @@ systemctl restart rsyslog
### Logrotate {{{
# Install new Logrotate configuration
if [ -f "${LOGROTATE_FILE}" ]; then
cp "${LOGROTATE_CONF}" "${LOGROTATE_FILE}"
if [ -f "${LOGROTATE_CONF_PATH}" ]; then
cp "${LOGROTATE_CONF_SRC}" "${LOGROTATE_CONF_PATH}"
fi
cp "${LOGROTATE_SYSLOG_CONF}" "${LOGROTATE_SYSLOG_FILE}"
cp "${LOGROTATE_APTITUDE_CONF}" "${LOGROTATE_APTITUDE_FILE}"
cp "${LOGROTATE_DPKG_CONF}" "${LOGROTATE_DPKG_FILE}"
cp -- "${LOGROTATE_INCLUDE_SRC}" "${LOGROTATE_INCLUDE_PATH}"
# Create an archive directory for some log files (aptitude, dpkg,…)
mkdir -p -- /var/log/old_logs.d /var/log/aptitude.d /var/log/dpkg.d /var/log/alternatives.d /var/log/syslog.d /var/log/cron.d /var/log/daemon.d /var/log/kern.d /var/log/lpr.d /var/log/mail.d /var/log/auth.d /var/log/messages.d