From 7eee0908df97fa89980d6d3329c01537ed48e34a Mon Sep 17 00:00:00 2001 From: Quentin Duchemin <quentinduchemin@tuta.io> Date: Wed, 10 Nov 2021 21:55:55 +0100 Subject: [PATCH] [LDAP] Start to add logrotate and rsyslog --- pica-openldap/Dockerfile | 8 ++++++++ pica-openldap/logrotate/openldap | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 pica-openldap/logrotate/openldap diff --git a/pica-openldap/Dockerfile b/pica-openldap/Dockerfile index 60b7426a..37cbe7cd 100644 --- a/pica-openldap/Dockerfile +++ b/pica-openldap/Dockerfile @@ -1,5 +1,13 @@ FROM osixia/openldap:1.4.0 LABEL maintainer="quentinduchemin@tuta.io,bonnest@utc.fr" +RUN apt-get update && \ + apt-get install rsyslog logrotate + +# TODO ajouter un cron +COPY ./logrotate/openldap /etc/logrotate.d/openldap + +RUN update-rc.d rsyslog defaults + ADD bootstrap /container/service/slapd/assets/config/bootstrap ADD environment /container/environment/01-custom diff --git a/pica-openldap/logrotate/openldap b/pica-openldap/logrotate/openldap new file mode 100644 index 00000000..2585c768 --- /dev/null +++ b/pica-openldap/logrotate/openldap @@ -0,0 +1,13 @@ +/var/log/*.log { + missingok + notifempty + compress + weekly + rotate 10 + size=50M + sharedscripts + postrotate + # OpenLDAP logs via syslog, restart syslog if running + /etc/init.d/rsyslog restart + endscript +} -- GitLab