[packages/samba] smb: skip only start if wrong role, allow other commands like stop and status

glen glen at pld-linux.org
Thu Apr 16 11:24:47 CEST 2015


commit 03252be7eb7b3fe883d697aa0cb8b5a602fef588
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Apr 16 12:24:39 2015 +0300

    smb: skip only start if wrong role, allow other commands like stop and status

 smb.init | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/smb.init b/smb.init
index a605f49..9b7f923 100755
--- a/smb.init
+++ b/smb.init
@@ -37,12 +37,12 @@ fi
 export TMPDIR=/tmp
 unset TMP || :
 
-SERVER_ROLE=$(samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -n1)
-if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
-	exit 0
-fi
-
 start() {
+	SERVER_ROLE=$(samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -n1)
+	if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
+		exit 0
+	fi
+
 	# Check if the service is already running?
 	if [ -f /var/lock/subsys/$lockname ]; then
 		msg_already_running "Samba SMB/CIFS Server"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/samba.git/commitdiff/03252be7eb7b3fe883d697aa0cb8b5a602fef588



More information about the pld-cvs-commit mailing list