From c5494ad09830d5740632f9146ebabe9cf6149cc6 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 22 Oct 2018 21:47:05 +0200 Subject: [PATCH] haproxy: Log to syslog and install logrotate script Signed-off-by: Michael Tremer --- config/etc/syslog.conf | 3 +++ config/haproxy/logrotate | 8 ++++++++ config/rootfiles/packages/haproxy | 1 + lfs/haproxy | 5 +++++ 4 files changed, 17 insertions(+) create mode 100644 config/haproxy/logrotate 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) -- 2.39.2