[Samba] Question Wiki Setup a Samba Active Directory Domain Controller

Rowland Penny rowlandpenny241155 at gmail.com
Mon Oct 5 17:33:38 UTC 2015


On 05/10/15 18:23, oeh univie edv lists wrote:
> Hello,
>
> Probably problem is numer 3... see below....
>
> All of them are running after restart of computer:
>
> # /etc/init.d/samba-ad-dc status
> ● samba-ad-dc.service - LSB: start Samba daemons for the AD DC
>   Loaded: loaded (/etc/init.d/samba-ad-dc)
>   Active: active (running) since Son 2015-10-04 23:14:36 CEST; 18h ago
>
> # /etc/init.d/samba status
> ● samba-ad-dc.service - LSB: start Samba daemons for the AD DC
>   Loaded: loaded (/etc/init.d/samba-ad-dc)
>   Active: active (running) since Son 2015-10-04 23:14:36 CEST; 18h ago
>
> # /etc/init.d/nmbd status
> ● nmbd.service - LSB: start Samba NetBIOS nameserver (nmbd)
>   Loaded: loaded (/etc/init.d/nmbd)
>   Active: active (exited) since Son 2015-10-04 23:14:36 CEST; 18h ago
>
> # /etc/init.d/smbd status
> ● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
>   Loaded: loaded (/etc/init.d/smbd)
>   Active: active (exited) since Son 2015-10-04 23:14:36 CEST; 18h ago
>
> winbind is not running.
>
> And yes, nmbd is in /usr/sbin.
>
> I checked my /etc/init.d/samba-ad-dc and it is the same as 
> http://anonscm.debian.org/gitweb/?p=pkg-samba/samba.git;a=blob_plain;f=debian/samba.samba-ad-dc.init;h=3132d2e367675f822342a5b7bc2e50c046aa3b8f;hb=HEAD which 
> is recommended for Debian on 
> https://wiki.samba.org/index.php/Samba4/InitScript .
>
> I got all those init scripts set to 755 like recommended:
> /etc/init.d # ls -l samba samba-ad-dc nmbd smbd
> -rwxr-xr-x 1 root root 1948 Mär  7  2015 nmbd
> -rwxr-xr-x 1 root root 1266 Mär  7  2015 samba
> -rwxr-xr-x 1 root root 2299 Mär  7  2015 samba-ad-dc
> -rwxr-xr-x 1 root root 1930 Mär  7  2015 smbd
>
> As far as I understand /etc/init.d/samba starts samba-ad-dc, smbd and 
> nmbd and the init each of them themselves check if the process is 
> needed or not. As far as I can understand the /etc/init.d/nmbd file 
> nmbd should not be started but exit, because I have an active 
> directory domain controller.
>
> I tested on the command line:
> >samba-tool testparm --parameter-name="server role"
> active directory domain controller
>
> I do not understand that behaviour. Furthermore I do not understand 
> why I do have to have a /etc/init.d/samba additionally to 
> /etc/init.d/samba-ad-dc. So what I did was stopping everything and 
> just start /etc/init.d/samba-ad-dc (which does not start nmbd and 
> smbd). Then I did all recommended tests of the Wiki again. 
> Everything's works fine. But am I going to run into problems later on? 
> Do I need to get rid of init files? I attached /etc/init.d/samba and 
> /etc/init.d/nmbd files below.
>
> Please can somebody point out
> 1) which init scripts/processes are necessary for Samba 4 AD DC
> 2) and most important: how to deactivate the unnecessary ones at startup
> 3) do I have mixed up my installation? To me it seems I somehow have a 
> samba 4 pdc and a samba 4 AD DC simultaneusly installed. Ow, now I 
> remember at provision I was informed to remove /etc/samba/smb.conf 
> (the one that was produced at samba install with aptitude which 
> included "server role = standalone server"). I renamed it to 
> smb_old.conf and then the AD AC installation succeeded. But did it 
> somehow install those unnecessary processes as wellt? If yes, how to 
> clean up? (I could also start the whole installation from scratch if 
> it is the easiest way to do it.)
>
> kind regards, birgit
>
>
>
>
>
> =========================================
>
> cat /etc/init.d/samba
> #!/bin/sh
>
> ### BEGIN INIT INFO
> # Provides:          samba
> # Required-Start:
> # Required-Stop:
> # Default-Start:
> # Default-Stop:
> # Short-Description: ensure Samba daemons are started (nmbd and smbd)
> ### END INIT INFO
>
> set -e
>
> # start nmbd, smbd and samba-ad-dc unconditionally
> # the init scripts themselves check if they are needed or not
> case $1 in
>        start)
>                /etc/init.d/nmbd start
>                /etc/init.d/smbd start
>                /etc/init.d/samba-ad-dc start
>                ;;
>        stop)
>                /etc/init.d/samba-ad-dc stop
>                /etc/init.d/smbd stop
>                /etc/init.d/nmbd stop
>                ;;
>        reload)
>                /etc/init.d/smbd reload
>                ;;
>        restart|force-reload)
>                /etc/init.d/nmbd "$1"
>                /etc/init.d/smbd "$1"
>                /etc/init.d/samba-ad-dc "$1"
>                ;;
>        status)
>                status=0
>                NMBD_DISABLED=`testparm -s --parameter-name='disable 
> netbios' 2>/dev/null || true`
>                SERVER_ROLE=`samba-tool testparm 
> --parameter-name="server role"  2>/dev/null | tail -1 || true`
>                if [ "$SERVER_ROLE" != "active directory domain 
> controller" ]; then
>                        if [ "$NMBD_DISABLED" != "Yes" ]; then
>                                /etc/init.d/nmbd status || status=$?
>                        fi
>                        /etc/init.d/smbd status || status=$?
>                else
>                        /etc/init.d/samba-ad-dc status || status=$?
>                fi
>                exit $status
>                ;;
>        *)
>                echo "Usage: /etc/init.d/samba 
> {start|stop|reload|restart|force-reload|status}"
>                exit 1
>                ;;
> esac
>
>
>
>
>
>
> # more /etc/init.d/nmbd
>
> #!/bin/sh
>
> ### BEGIN INIT INFO
> # Provides:          nmbd
> # Required-Start:    $network $local_fs $remote_fs
> # Required-Stop:     $network $local_fs $remote_fs
> # X-Start-Before:    smbd
> # Default-Start:     2 3 4 5
> # Default-Stop:      0 1 6
> # Short-Description: start Samba NetBIOS nameserver (nmbd)
> ### END INIT INFO
>
> PIDDIR=/var/run/samba
> NMBDPID=$PIDDIR/nmbd.pid
>
> # clear conflicting settings from the environment
> unset TMPDIR
>
> # See if the daemons are there
> test -x /usr/sbin/nmbd || exit 0
>
> . /lib/lsb/init-functions
>
> case $1 in
>        start)
>                if init_is_upstart; then
>                        exit 1
>                fi
>                SERVER_ROLE=`samba-tool testparm 
> --parameter-name="server role"  2>/dev/null | tail -1`
>                if [ "$SERVER_ROLE" = "active directory domain 
> controller" ]; then
>                    exit 0
>                fi
>
>                if [ -n `which testparm` ]
>                then
>                        NMBD_DISABLED=`testparm -s 
> --parameter-name='disable netbios' 2>/dev/null`
>                fi
>                if [ "$NMBD_DISABLED" != Yes ]; then
>                        log_daemon_msg "Starting NetBIOS name server" nmbd
>                        # Make sure we have our PIDDIR, even if it's on 
> a tmpfs
>                        install -o root -g root -m 755 -d $PIDDIR
>
>                        if ! start-stop-daemon --start --quiet --oknodo 
> --exec /usr/sbin/nmbd -- -D
>                        then
>                                log_end_msg 1
>                                exit 1
>                        fi
>                        log_end_msg 0
>                fi
>
>                ;;
> esac
> exit 0
>
> When I just start "/etc/init.d/samba-ad-dc start" nmbd and smbd are 
> not started.
>
>
>

If you are running SAMBA as an AD DC you only need to START samba-ad-dc
This will start the samba daemon, which will in turn start the smbd 
daemon and the winbindd daemon
You need to stop the other startup scripts being run at startup.

there is no network browsing with an AD DC

Rowland


More information about the samba mailing list