diff options
author | Gerald Carter <jerry@samba.org> | 2005-10-17 17:10:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:01 -0500 |
commit | 7808def3e947c26bfbb46827dc5296efcc57d982 (patch) | |
tree | 6de6d82c243d0c7045a84a2bdf70c2b72bd52faf | |
parent | e19ea8f2473147dd94c32b82e99dc2fe282a6cbf (diff) | |
download | samba-7808def3e947c26bfbb46827dc5296efcc57d982.tar.gz samba-7808def3e947c26bfbb46827dc5296efcc57d982.tar.bz2 samba-7808def3e947c26bfbb46827dc5296efcc57d982.zip |
r11127: patch from S Murthy Kambhampaty <smk_va@yahoo.com> to not start nmbd is 'disable netbios = yes'
(This used to be commit decaf8da598b09ea4c5382dc1f6c4be1664e20c7)
-rw-r--r-- | packaging/Fedora/smb.init | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/packaging/Fedora/smb.init b/packaging/Fedora/smb.init index 11a011883f..30d7d403dd 100644 --- a/packaging/Fedora/smb.init +++ b/packaging/Fedora/smb.init @@ -37,40 +37,56 @@ 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}') + RETVAL=0 start() { - KIND="SMB" + KIND="SMB" echo -n $"Starting $KIND services: " daemon smbd $SMBDOPTIONS RETVAL=$? echo - KIND="NMB" - echo -n $"Starting $KIND services: " - daemon nmbd $NMBDOPTIONS - RETVAL2=$? - echo - [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \ - RETVAL=1 + KIND="NMB" + if [ x"$ISNETBIOSDISABLED" != x"Yes" ]; then + echo -n $"Starting $KIND services: " + daemon nmbd $NMBDOPTIONS + RETVAL2=$? + echo + [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \ + RETVAL=1 + else + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb || \ + RETVAL=1 + fi return $RETVAL } stop() { - KIND="SMB" + KIND="SMB" echo -n $"Shutting down $KIND services: " killproc smbd -TERM RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/run/smbd.pid echo KIND="NMB" - echo -n $"Shutting down $KIND services: " - killproc nmbd -TERM - RETVAL2=$? - [ $RETVAL2 -eq 0 ] && rm -f /var/run/nmbd.pid - [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb - echo "" + if [ x"$ISNETBIOSDISABLED" != x"Yes" ]; then + echo -n $"Shutting down $KIND services: " + killproc nmbd -TERM + RETVAL2=$? + [ $RETVAL2 -eq 0 ] && rm -f /var/run/nmbd.pid + [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb + echo "" + else + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smb + echo "" + fi return $RETVAL } |