[Pkg-samba-maint] [samba] 04/07: Use smbcontrol in logrotate when available (Closes: #804705)

Mathieu Parent sathieu at moszumanska.debian.org
Wed Jul 19 20:46:50 UTC 2017


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

sathieu pushed a commit to branch master
in repository samba.

commit fa14ec7a38e036708ee179772d36ac77f5721abb
Author: Mathieu Parent <math.parent at gmail.com>
Date:   Wed Jul 19 21:57:47 2017 +0200

    Use smbcontrol in logrotate when available (Closes: #804705)
    
    This handle gracefully the stopped services.
---
 debian/samba.logrotate   | 4 ++--
 debian/winbind.logrotate | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/debian/samba.logrotate b/debian/samba.logrotate
index 556c4a2..b41ec7b 100644
--- a/debian/samba.logrotate
+++ b/debian/samba.logrotate
@@ -3,7 +3,7 @@
 	missingok
 	rotate 7
 	postrotate
-		[ ! -f /var/run/samba/smbd.pid ] || /etc/init.d/smbd reload > /dev/null
+		[ ! -x /usr/bin/smbcontrol ] || /usr/bin/smbcontrol smbd reload-config
 	endscript
 	compress
 	delaycompress
@@ -15,7 +15,7 @@
 	missingok
 	rotate 7
 	postrotate
-		[ ! -f /var/run/samba/nmbd.pid ] || kill -HUP `cat /var/run/samba/nmbd.pid`
+		[ ! -x /usr/bin/smbcontrol ] || /usr/bin/smbcontrol nmbd reload-config
 	endscript
 	compress
 	delaycompress
diff --git a/debian/winbind.logrotate b/debian/winbind.logrotate
index 2e05ba7..43ae1af 100644
--- a/debian/winbind.logrotate
+++ b/debian/winbind.logrotate
@@ -3,7 +3,11 @@
 	missingok
 	rotate 7
 	postrotate
-	[ ! -f /var/run/samba/winbindd.pid ] || kill -HUP `cat /var/run/samba/winbindd.pid`
+		if [ -x /usr/bin/smbcontrol ]; then
+			/usr/bin/smbcontrol winbindd reload-config
+		elif [ -f /var/run/samba/winbindd.pid ]; then
+			kill -HUP `cat /var/run/samba/winbindd.pid`
+		fi
 	endscript
 	compress
 	delaycompress

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list