From: Michael Tremer Date: Mon, 22 Oct 2018 19:47:05 +0000 (+0200) Subject: haproxy: Log to syslog and install logrotate script X-Git-Tag: v2.21-core125~39^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5494ad09830d5740632f9146ebabe9cf6149cc6;p=people%2Fpmueller%2Fipfire-2.x.git haproxy: Log to syslog and install logrotate script Signed-off-by: Michael Tremer --- diff --git a/config/etc/syslog.conf b/config/etc/syslog.conf index cdef756822..d5f525a0ec 100644 --- a/config/etc/syslog.conf +++ b/config/etc/syslog.conf @@ -21,3 +21,6 @@ cron.none;daemon.*;local0.*;local2.*;*.info;mail.none;authpriv.* -/var/log/messa # Postfix logs mail.* -/var/log/mail + +# HAProxy +local1.* -/var/log/haproxy diff --git a/config/haproxy/logrotate b/config/haproxy/logrotate new file mode 100644 index 0000000000..aa02505ee6 --- /dev/null +++ b/config/haproxy/logrotate @@ -0,0 +1,8 @@ +/var/log/haproxy { + missingok + notifempty + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + endscript +} diff --git a/config/rootfiles/packages/haproxy b/config/rootfiles/packages/haproxy index 515145d588..7677ba4ad4 100644 --- a/config/rootfiles/packages/haproxy +++ b/config/rootfiles/packages/haproxy @@ -1,5 +1,6 @@ #etc/haproxy etc/haproxy/haproxy.cfg +etc/logrotate.d/haproxy etc/rc.d/init.d/haproxy usr/sbin/haproxy #usr/sbin/haproxy-systemd-wrapper diff --git a/lfs/haproxy b/lfs/haproxy index 5e181a91e2..1103e331aa 100644 --- a/lfs/haproxy +++ b/lfs/haproxy @@ -98,5 +98,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) #install initscripts $(call INSTALL_INITSCRIPT,haproxy) + # Logrotate + -mkdir -pv /etc/logrotate.d + install -v -m 644 $(DIR_SRC)/config/haproxy/logrotate \ + /etc/logrotate.d/haproxy + @rm -rf $(DIR_APP) @$(POSTBUILD)