Adapt the logrotate for Debian 9 and 10

Signed-off-by: Alban Vidal <alban.vidal@zordhak.fr>
This commit is contained in:
Alban Vidal 2019-03-22 05:42:28 +01:00
parent 2f440ebbda
commit 1eca671f2c

View File

@ -2,7 +2,7 @@
# BSD 3-Clause License
#
# Copyright (c) 2018, Alban Vidal <alban.vidal@zordhak.fr>
# Copyright (c) 2018-2019, Alban Vidal <alban.vidal@zordhak.fr>
# 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