haproxy: Log to syslog and install logrotate script
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Oct 2018 19:47:05 +0000 (21:47 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Oct 2018 19:47:05 +0000 (21:47 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/etc/syslog.conf
config/haproxy/logrotate [new file with mode: 0644]
config/rootfiles/packages/haproxy
lfs/haproxy

index cdef756..d5f525a 100644 (file)
@@ -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 (file)
index 0000000..aa02505
--- /dev/null
@@ -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
+}
index 515145d..7677ba4 100644 (file)
@@ -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
index 5e181a9..1103e33 100644 (file)
@@ -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)