[packages/samba] - don't try to stop nmbd or check its status if it is disabled

hawk hawk at pld-linux.org
Thu Apr 4 21:33:37 CEST 2024


commit 8e0e313533b357ede87b194bdaa838e3b08cb182
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Thu Apr 4 21:22:41 2024 +0200

    - don't try to stop nmbd or check its status if it is disabled

 smb.init | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/smb.init b/smb.init
index 9b7f923..ded9c30 100755
--- a/smb.init
+++ b/smb.init
@@ -73,8 +73,11 @@ stop() {
 	msg_stopping "Samba SMB/CIFS Server"
 	killproc --pidfile $smbd_pidfile smbd
 
-	msg_stopping "Samba NetBIOS Name Server"
-	killproc --pidfile $nmbd_pidfile nmbd
+	NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
+	if [ "$NMBD_DISABLED" != Yes ]; then
+		msg_stopping "Samba NetBIOS Name Server"
+		killproc --pidfile $nmbd_pidfile nmbd
+	fi
 	rm -f /var/lock/subsys/$lockname >/dev/null 2>&1
 }
 
@@ -104,9 +107,12 @@ condrestart() {
 rc_status() {
 	status smbd
 	RETVAL=$?
-	status nmbd
-	RET=$?
-	[ $RETVAL -eq 0 ] && RETVAL=$RET
+	NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
+	if [ "$NMBD_DISABLED" != Yes ]; then
+		status nmbd
+		RET=$?
+		[ $RETVAL -eq 0 ] && RETVAL=$RET
+	fi
 }
 
 RETVAL=0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/samba.git/commitdiff/8e0e313533b357ede87b194bdaa838e3b08cb182



More information about the pld-cvs-commit mailing list