]> git.pld-linux.org Git - packages/samba.git/blobdiff - smb.init
- handle libsmbconf.so.0 transition from library file to soname symlink
[packages/samba.git] / smb.init
old mode 100644 (file)
new mode 100755 (executable)
index d129f75..9b7f923
--- a/smb.init
+++ b/smb.init
@@ -17,8 +17,8 @@
 
 # Set default config
 CFGFILE="/etc/samba/smb.conf"
-smbd_pidfile="/var/run/smbd.pid"
-nmbd_pidfile="/var/run/nmbd.pid"
+smbd_pidfile="/var/run/samba/smbd.pid"
+nmbd_pidfile="/var/run/samba/nmbd.pid"
 lockname=smb
 
 # Demon specified configuration.
@@ -34,10 +34,15 @@ else
        exit 0
 fi
 
-TMPDIR="/tmp"; export TMPDIR
+export TMPDIR=/tmp
 unset TMP || :
 
 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"
@@ -47,9 +52,12 @@ start() {
        msg_starting "Samba SMB/CIFS Server"
        daemon /usr/sbin/smbd -D -s $CFGFILE
        RETVAL=$?
-       msg_starting "Samba NetBIOS Name Server"
-       daemon /usr/sbin/nmbd -D $CFGFILE
-       [ $RETVAL -eq 0 ] && RETVAL=$?
+       NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
+       if [ "$NMBD_DISABLED" != Yes ]; then
+               msg_starting "Samba NetBIOS Name Server"
+               daemon /usr/sbin/nmbd -D $CFGFILE
+               [ $RETVAL -eq 0 ] && RETVAL=$?
+       fi
        if [ $RETVAL -eq 0 ]; then
                touch /var/lock/subsys/$lockname
        fi
This page took 0.409528 seconds and 4 git commands to generate.