From 1eca671f2c5331dd1afd901bc05f36ef7455d2c3 Mon Sep 17 00:00:00 2001 From: Alban Vidal Date: Fri, 22 Mar 2019 05:42:28 +0100 Subject: [PATCH] Adapt the logrotate for Debian 9 and 10 Signed-off-by: Alban Vidal --- auto_config.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/auto_config.sh b/auto_config.sh index 02c611e..05acab9 100755 --- a/auto_config.sh +++ b/auto_config.sh @@ -2,7 +2,7 @@ # BSD 3-Clause License # -# Copyright (c) 2018, Alban Vidal +# Copyright (c) 2018-2019, Alban Vidal # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -154,16 +154,20 @@ ln -sf $GIT_DIR/root/.profile.d/01_stats_connexion.conf /root/.profile.d/ # vimrc ln -sf $GIT_DIR/root/.vimrc /root/ +################################################################################ + ## Tune logrotate -# Fix logrotate bug -cat << EOF > /etc/cron.daily/logrotate -#!/bin/sh -test -x /usr/sbin/logrotate || exit 0 -/usr/sbin/logrotate -f /etc/logrotate.conf -EOF + +# Force rotate if is launched by cron +# change : /usr/sbin/logrotate /etc/logrotate.conf +# by : /usr/sbin/logrotate -f /etc/logrotate.conf +sed -i 's#\(/usr/sbin/logrotate\).*\(/etc/logrotate.conf\)#\1 -f \2#' /etc/cron.daily/logrotate + # Disable delaycompress sed -i 's/.*delaycompress/#&/' /etc/logrotate.d/* +################################################################################ + # Disable IPv6 if $DISABLE_IPv6 ; then cat << EOF > /etc/sysctl.d/98-disable-ipv6.conf