[Pkg-sympa-commits] [sympa] 09/28: Set rsyslog as default syslog daemon (#728114)

Emmanuel Bouthenot kolter at moszumanska.debian.org
Wed Jun 11 21:53:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

kolter pushed a commit to branch master
in repository sympa.

commit 039dbd132dd3447c4fef1fc9a58e76495032e230
Author: Emmanuel Bouthenot <kolter at openics.org>
Date:   Sun May 4 21:36:19 2014 +0200

    Set rsyslog as default syslog daemon (#728114)
---
 debian/conf/rsyslog/facility |  1 +
 debian/conf/sympa.conf       |  2 +-
 debian/rules                 |  2 +-
 debian/sympa.install         |  1 +
 debian/sympa.logrotate       |  1 -
 debian/sympa.postinst        | 19 +------------------
 debian/sympa.postrm          | 16 ----------------
 7 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/debian/conf/rsyslog/facility b/debian/conf/rsyslog/facility
new file mode 100644
index 0000000..ecb8042
--- /dev/null
+++ b/debian/conf/rsyslog/facility
@@ -0,0 +1 @@
+LOCAL1
diff --git a/debian/conf/sympa.conf b/debian/conf/sympa.conf
index 890954f..32d26ae 100644
--- a/debian/conf/sympa.conf
+++ b/debian/conf/sympa.conf
@@ -18,7 +18,7 @@ pidfile		/var/run/sympa/sympa.pid
 umask		027
 
 ## Facility used by Syslogd
-syslog		`/bin/cat /etc/sympa/facility`
+syslog		`cat /etc/sympa/facility`
 
 ## Communication mode with syslogd is either 'unix' (via Unix sockets) or
 ## 'inet' (use of UDP)
diff --git a/debian/rules b/debian/rules
index 2da07e1..8f428c2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -173,7 +173,7 @@ CDBS_BUILD_DEPENDS += , debconf-utils, po-debconf
 # Needed (always/often) at runtime
 CDBS_DEPENDS = $(common-depends)
 CDBS_DEPENDS += , default-mta | mail-transport-agent, ca-certificates
-CDBS_DEPENDS += , sysklogd (>= 1.3-27) | system-log-daemon
+CDBS_DEPENDS += , rsyslog | system-log-daemon
 CDBS_DEPENDS += , lsb-base, adduser, debconf | debconf-2.0, dbconfig-common
 CDBS_DEPENDS += , libdbd-mysql-perl (>= 4.007), libdbd-pg-perl
 CDBS_DEPENDS += , libdbd-sybase-perl, libdbd-sqlite3-perl, sqlite3
diff --git a/debian/sympa.install b/debian/sympa.install
index 4cac3ad..59e2527 100644
--- a/debian/sympa.install
+++ b/debian/sympa.install
@@ -1,4 +1,5 @@
 debian/conf/rsyslog/sympa.conf      etc/rsyslog.d
+debian/conf/rsyslog/facility        etc/sympa
 debian/conf/apache2/sympa.conf      etc/apache2/conf-available
 debian/conf/apache2/sympa-soap.conf etc/apache2/conf-available
 debian/conf/auth.conf               etc/sympa
diff --git a/debian/sympa.logrotate b/debian/sympa.logrotate
index 3578c95..23d9aa1 100644
--- a/debian/sympa.logrotate
+++ b/debian/sympa.logrotate
@@ -9,6 +9,5 @@
 	postrotate
 		invoke-rc.d --quiet sympa reload > /dev/null
 		invoke-rc.d --quiet rsyslog rotate > /dev/null || true
-		invoke-rc.d --quiet sysklogd reload > /dev/null || true
 	endscript
 }
diff --git a/debian/sympa.postinst b/debian/sympa.postinst
index 60eff56..690e7c9 100644
--- a/debian/sympa.postinst
+++ b/debian/sympa.postinst
@@ -85,6 +85,7 @@ fi
 if [ ! -f "$wwconf" ]; then
 	/usr/lib/sympa/bin/sympa_wizard.pl --create wwsympa.conf --target "$wwconf"
 	perl -i -pe 's%^(arc_path\s+).*%$1/var/lib/sympa/wwsarchive%; s%^(bounce_path\s+).*%$1/var/spool/sympa/wwsbounce%' "$wwconf"
+	perl -i -pe 's%^(log_facility\s+).*%log_facility `cat /etc/sympa/facility`%;' "$wwconf"
 fi
 
 # Configure the language
@@ -190,24 +191,6 @@ for ext in '' '.db' ; do
 	fi
 done
 
-## Setup a syslog facility
-if which syslog-facility >/dev/null 2>&1 \
-		&& [ -e /etc/syslog.conf ] \
-		&& ! grep -q "/var/log/sympa.log" /etc/syslog.conf \
-		&& syslog-facility set all /var/log/sympa.log > /etc/sympa/facility \
-		&& [ -x /etc/init.d/sysklogd ]; then
-	if which invoke-rc.d >/dev/null 2>&1; then
-		invoke-rc.d sysklogd reload
-	else
-		etc/init.d/sysklogd reload
-	fi
-fi
-## ...and ensure existence and access rights of facility file even if unused
-if [ ! -e /etc/sympa/facility ]; then
-	touch /etc/sympa/facility
-fi
-chown sympa:sympa /etc/sympa/facility
-
 ## Create a unique cookie for this host
 if [ ! -e /etc/sympa/cookie ]; then
 	touch /etc/sympa/cookie
diff --git a/debian/sympa.postrm b/debian/sympa.postrm
index da4efc8..a55a60c 100644
--- a/debian/sympa.postrm
+++ b/debian/sympa.postrm
@@ -20,22 +20,6 @@ if which dpkg-maintscript-helper >/dev/null && dpkg-maintscript-helper supports
 fi
 
 if [ "$1" = "remove" ]; then
-	# Check whether the syslog configuration file is present in case
-	# another system log daemon is used instead of syslog
-	if [ -f /etc/sympa/facility ]; then
-		if perl -ne '/(\S+)/ || exit 1; $ENV{facility}=$1; exit' /etc/sympa/facility \
-		&& which syslog-facility >/dev/null 2>&1 \
-		&& [ -e /etc/syslog.conf ] \
-		&& syslog-facility remove "$facility" \
-		&& [ -x /etc/init.d/sysklogd ]; then
-			if which invoke-rc.d >/dev/null 2>&1; then
-				invoke-rc.d sysklogd reload
-			else
-				etc/init.d/sysklogd reload
-			fi
-		fi
-		rm -f /etc/sympa/facility
-	fi
 	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
 		# Apache2 >= 2.4
 		. /usr/share/apache2/apache2-maintscript-helper

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/sympa.git



More information about the Pkg-sympa-commits mailing list