* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 3ed2de12510dcca5dea8e96b02f785cb0f8fe10c
@ 2018-10-29 11:00 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2018-10-29 11:00 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 4601 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via 3ed2de12510dcca5dea8e96b02f785cb0f8fe10c (commit)
via c5494ad09830d5740632f9146ebabe9cf6149cc6 (commit)
via 699f0aa710932736d34dabf5a8c17287af29075c (commit)
from 02776a0dc27051337ecaf0212a740c642b337378 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3ed2de12510dcca5dea8e96b02f785cb0f8fe10c
Merge: 02776a0dc c5494ad09
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Oct 29 11:59:18 2018 +0100
Merge branch 'haproxy' into next
commit c5494ad09830d5740632f9146ebabe9cf6149cc6
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Oct 22 21:47:05 2018 +0200
haproxy: Log to syslog and install logrotate script
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
commit 699f0aa710932736d34dabf5a8c17287af29075c
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Oct 22 21:39:31 2018 +0200
haproxy: Make /dev/log available in chroot
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
config/etc/syslog.conf | 3 +++
config/haproxy/logrotate | 8 ++++++++
config/rootfiles/packages/haproxy | 1 +
lfs/haproxy | 7 ++++++-
src/initscripts/packages/haproxy | 14 ++++++++++++++
5 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 config/haproxy/logrotate
Difference in files:
diff --git a/config/etc/syslog.conf b/config/etc/syslog.conf
index cdef75682..d5f525a0e 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 000000000..aa02505ee
--- /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 515145d58..7677ba4ad 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 9a54095a8..1103e331a 100644
--- a/lfs/haproxy
+++ b/lfs/haproxy
@@ -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)
diff --git a/src/initscripts/packages/haproxy b/src/initscripts/packages/haproxy
index 78d64cee4..ded627773 100644
--- a/src/initscripts/packages/haproxy
+++ b/src/initscripts/packages/haproxy
@@ -11,6 +11,15 @@
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)
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-10-29 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 11:00 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 3ed2de12510dcca5dea8e96b02f785cb0f8fe10c Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox