[Samba] Provisioning new AD Domain Controller

Mark Foley mfoley at novatec-inc.com
Thu Nov 30 18:56:19 UTC 2023


On Thu Nov 30 13:29:36 2023 bd730c5053df9efb via samba <samba at lists.samba.org> wrote:
>
> I have ran samba as a pdc since the 90's using slackware's stock rc.samba script but once I moved from samba PDC to samba AD DC I created a new script, very similar but what it does is, first and foremost check samba isn't running in a non AD DC configuration started by slackwares standard script and then start /usr/sbin/samba -D instead of /usr/sbin/smbd -D and /usr/sbin/nmbd -D. Here is my complete script
>
> #!/bin/sh
> #
> # /etc/rc.d/rc.sambaad
> #
> # Start/stop/restart the Samba SMB active directory domain controller
> #
> # To make Samba start automatically at boot, make this
> # file executable:  chmod 755 /etc/rc.d/rc.sambaad
> # and add it to rc.local
> #
>
> sambaad_start() {
>   if [ -x /etc/rc.d/rc.samba ]; then
>     echo "Samba is already running, can not start Samba AD server"
>   else
>     if [ -x /usr/sbin/samba -a -r /etc/samba/smb.conf ]; then
>       mkdir -p /var/run/samba
>       echo "Starting Samba AD:  /usr/sbin/samba -D"
>       /usr/sbin/samba -D
>     elif [ ! -r /etc/samba/smb.conf ]; then
>       echo "ERROR:  cannot start Samba since /etc/samba/smb.conf does not exist"
>     fi
>   fi
> }
>
> sambaad_stop() {
>   if [ -r /var/run/samba.pid ]; then
>     kill -TERM $(cat /var/run/samba.pid)
>   fi
> }
>
> sambaad_restart() {
>   sambaad_stop
>   sleep 2
>   sambaad_start
> }
>
> case "$1" in
> 'start')
>   sambaad_start
>   ;;
> 'stop')
>   sambaad_stop
>   ;;
> 'restart')
>   sambaad_restart
>   ;;
> *)
>   echo "usage $0 start|stop|restart"
> esac
>
> Best regards,
> Dave.

Ah ha! Now that I've checked my rc files more closely, I see that I've done the
same as you. I have a rc.sambaDC script.

I'll compare that with yours to see if I'm missing anything.

Thanks --Mark



More information about the samba mailing list