From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ginster.hi.pengutronix.de ([2001:67c:670:100:2e4d:54ff:fe67:bfa5] helo=ginster) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i5p9C-0004V4-Bz for ptxdist@pengutronix.de; Thu, 05 Sep 2019 12:37:50 +0200 Received: from jbe by ginster with local (Exim 4.89) (envelope-from ) id 1i5p9C-0003JD-3W for ptxdist@pengutronix.de; Thu, 05 Sep 2019 12:37:50 +0200 From: Juergen Borleis Date: Thu, 5 Sep 2019 12:37:50 +0200 Message-Id: <20190905103750.12681-1-jbe@pengutronix.de> Subject: [ptxdist] [PATCH] logrotate: change from single config file to drop-in directory List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Instead of using only one single config file, a drop-in directory is more useful to support various users of 'logrotate'. This change still expects the BSP to provide the '/etc/logrotate.d' directory and the required config files in there. Signed-off-by: Juergen Borleis --- projectroot/etc/logrotate.conf | 14 +------------- rules/logrotate.in | 7 ++++++- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/projectroot/etc/logrotate.conf b/projectroot/etc/logrotate.conf index d872dcc5d..e3d85c4ff 100644 --- a/projectroot/etc/logrotate.conf +++ b/projectroot/etc/logrotate.conf @@ -1,13 +1 @@ -/var/log/syslog { - missingok - - # rotate after X bytes - ignore time - size 512k - - # keep backlog of X - rotate 20 - - postrotate - systemctl restart rsyslog - endscript -} +include /etc/logrotate.d diff --git a/rules/logrotate.in b/rules/logrotate.in index 097804017..f3b465b87 100644 --- a/rules/logrotate.in +++ b/rules/logrotate.in @@ -15,8 +15,13 @@ menuconfig LOGROTATE log file gets to a certain size. Normally, logrotate runs as a daily cron job. + In order to make 'logrotate' work at run-time, a directory + '/etc/logrotate.d' is required which must contain your own 'logrotate' + config files (refer the manpage). There are no defaults in this + package. + Note: on a read-only root filesystem this package still requires a - writable '/var/lib' for its run-time information. + writable '/var/lib' for its run-time state information. if LOGROTATE -- 2.11.0 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de