packaging(RHEL-CTDB): control starting of nmbd via START_NMBD from /etc/sysconfig... 3.2.11-ctdb-65
authorMichael Adam <obnox@samba.org>
Tue, 22 Sep 2009 12:26:35 +0000 (14:26 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 22 Sep 2009 12:26:35 +0000 (14:26 +0200)
Michael

packaging/RHEL-CTDB/setup/samba.sysconfig
packaging/RHEL-CTDB/setup/smb.init

index 944b72fcc284d4c5a62dd83cc9b51a73add1f334..84480f69a2c068c03b6bd61080474653c3befa3c 100644 (file)
@@ -4,3 +4,5 @@ SMBDOPTIONS="-D"
 NMBDOPTIONS="-D"
 # Options for winbindd
 WINBINDOPTIONS=""
+# start nmbd? yes/no
+START_NMBD=no
index 4dd5b23ae7bf2c92cd507d45f80e83cd70cf6314..cb893c195c6f1a775580004d9f0a596ea021a35a 100644 (file)
@@ -24,10 +24,17 @@ unset TMPDIR
 # Source networking configuration.
 . /etc/sysconfig/network
 
+# Don't start NMBD by default.
+# This can be overridden in /etc/sysconfig/samba .
+START_NMBD="no"
+
 if [ -f /etc/sysconfig/samba ]; then
    . /etc/sysconfig/samba
 fi
 
+# be friendly - convert the value to lower case
+START_NMBD=$(echo $START_NMBD | tr A-Z a-z)
+
 # Check that networking is up.
 [ ${NETWORKING} = "no" ] && exit 0
 
@@ -37,14 +44,6 @@ fi
 # Check that we can write to it... so non-root users stop here
 [ -w /etc/samba/smb.conf ] || exit 0
 
-# Check whether "netbios disabled" is true
-#ISNETBIOSDISABLED=$(testparm -s 2>/dev/null | \
-#      sed -n '/\[global\]/,/^$/p' | \
-#      grep "disable netbios = Yes" | \
-#      awk 'BEGIN{FS=" = "}{print $2}')
-
-ISNETBIOSDISABLED=Yes
-
 RETVAL=0
 
 
@@ -55,7 +54,7 @@ start() {
        RETVAL=$?
        echo
        KIND="NMB"
-       if [ x"$ISNETBIOSDISABLED" != x"Yes" ]; then
+       if [ x"$START_NMBD" = x"yes" ]; then
                echo -n $"Starting $KIND services: "
                daemon nmbd $NMBDOPTIONS
                RETVAL2=$?
@@ -77,7 +76,7 @@ stop() {
        [ $RETVAL -eq 0 ] && rm -f /var/run/smbd.pid
        echo
        KIND="NMB"
-       if [ x"$ISNETBIOSDISABLED" != x"Yes" ]; then
+       if [ x"$START_NMBD" = x"yes" ]; then
                echo -n $"Shutting down $KIND services: "
                killproc nmbd 
                RETVAL2=$?