[packages/mailman] Rel 2; don't restart mailman on logrotate; use its reopen mechanism instead

arekm arekm at pld-linux.org
Sat Dec 2 14:51:52 CET 2023


commit ea582fdee080201a95363e8b85a0d6e4216b96db
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Dec 2 14:03:40 2023 +0100

    Rel 2; don't restart mailman on logrotate; use its reopen mechanism instead

 mailman.init      | 15 ++++++++++++++-
 mailman.logrotate |  2 +-
 mailman.spec      |  2 +-
 3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/mailman.spec b/mailman.spec
index fb71394..b2a7ca0 100644
--- a/mailman.spec
+++ b/mailman.spec
@@ -2,7 +2,7 @@
 # Conditional build:
 %bcond_with	umbrella_hack	# break anonimization (for use with moderated umbrella list of moderated lists)
 
-%define		rel	1
+%define		rel	2
 Summary:	The GNU Mailing List Management System
 Summary(es.UTF-8):	El Sistema de Mantenimiento de listas de GNU
 Summary(pl.UTF-8):	System Zarządzania Listami Pocztowymi GNU
diff --git a/mailman.init b/mailman.init
index 9c5c7b7..0da3413 100755
--- a/mailman.init
+++ b/mailman.init
@@ -63,6 +63,16 @@ condrestart() {
 	fi
 }
 
+flushlogs() {
+    if [ -f /var/lock/subsys/mailman ]; then
+                daemon --user mailman /usr/lib/mailman/bin/mailmanctl -u reopen > /dev/null
+                RETVAL=$?
+    else
+                msg_not_running "Mailman Qrunner Daemon"
+                RETVAL=1
+    fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -82,12 +92,15 @@ case "$1" in
   force-reload)
 	condrestart 7
 	;;
+  flush-logs)
+        flushlogs
+        ;;
   status)
 	/usr/lib/mailman/bin/mailmanctl status
 	exit $?
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status|flush-logs}"
 	exit 3
 esac
 
diff --git a/mailman.logrotate b/mailman.logrotate
index bb70bef..e8e64ba 100644
--- a/mailman.logrotate
+++ b/mailman.logrotate
@@ -4,6 +4,6 @@
 	create 660 mailman mailman
 	monthly
 	postrotate
-		/sbin/service mailman restart >/dev/null
+		/sbin/service mailman flush-logs
 	endscript
 }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mailman.git/commitdiff/ea582fdee080201a95363e8b85a0d6e4216b96db



More information about the pld-cvs-commit mailing list