]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge branch 'haproxy' into next
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 29 Oct 2018 10:59:18 +0000 (11:59 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 29 Oct 2018 10:59:18 +0000 (11:59 +0100)
config/etc/syslog.conf
config/haproxy/logrotate [new file with mode: 0644]
config/rootfiles/packages/haproxy
lfs/haproxy
src/initscripts/packages/haproxy

index cdef756822c88d841ad1e1ff2a7be0d7268f71b7..d5f525a0ecf96f1dd5f3e24f6f80bcb002f420a3 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 515145d5884e2c89f96ed625f70151a36ce037ff..7677ba4ad4a53a48a60b26f7cd5a0365308a5d5b 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 9a54095a84c2037a1fbecee40e96aeaa71e0cac5..1103e331aa25305d901e6bed552e06e2a780841e 100644 (file)
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = haproxy
-PAK_VER    = 4
+PAK_VER    = 5
 
 DEPS       = ""
 
@@ -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)
index 78d64cee4e2309facc174b665a919041797d72ba..ded627773f5d1e02b1d06f4a0423f08e969b6785 100644 (file)
 
 case "${1}" in
        start)
+               # Prepare chroot
+               mkdir -p /var/lib/haproxy/dev
+
+               # Create link for syslog socket
+               if ! mountpoint /var/lib/haproxy/dev/log &>/dev/null; then
+                       touch /var/lib/haproxy/dev/log
+                       mount --bind /dev/log /var/lib/haproxy/dev/log
+               fi
+
                boot_mesg "Starting HAProxy..."
                loadproc /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg \
                        -p /var/run/haproxy.pid
@@ -19,6 +28,11 @@ case "${1}" in
        stop)
                boot_mesg "Stopping HAProxy..."
                killproc /usr/sbin/haproxy
+
+               # umount /dev/log
+               if mountpoint /var/lib/haproxy/dev/log &>/dev/null; then
+                       umount /var/lib/haproxy/dev/log
+               fi
                ;;
 
        reload)