Results 1 to 2 of 2

Thread: Starting Samba4 as DC daemon at boot

  1. #1
    Join Date
    Apr 2013
    Location
    Bordeaux, France
    Beans
    122
    Distro
    Ubuntu 13.04 Raring Ringtail

    Starting Samba4 as DC daemon at boot

    If you installed Samba 4 from git using my previous tutorial ( http://ubuntuforums.org/showthread.php?t=2146198 ),
    you might have noticed that it doesn't contain a self starting script so you have to start it manually everytime you reboot your server.

    Here is how to do to have it starting automatically:

    First create a samba4.conf file in /etc/init:

    Code:
    sudo nano /etc/init/samba4.conf
    Add this Upstart script inside:

    Code:
    description "SMB/CIFS File and Active Directory Server"
    author      "Jelmer Vernooij "
    start on (local-filesystems and net-device-up)
    stop on runlevel [!2345]
    expect fork
    normal exit 0
    pre-start script
    	[ -r /etc/default/samba4 ] && . /etc/default/samba4
    	install -o root -g root -m 755 -d /var/run/samba
    	install -o root -g root -m 755 -d /var/log/samba
    end script
    exec /usr/local/samba/sbin/samba -D
    Save and exit

    then execute those commands:

    Code:
    chmod 755 /etc/init/samba4.conf
    chmod +x /etc/init/samba4.conf
    Restart

    Now your samba server should start automatically at reboot.
    One step further might be one step too far...

  2. #2
    Join Date
    Jan 2013
    Location
    Norrkoping, Sweden
    Beans
    144
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Starting Samba4 as DC daemon at boot

    Thank you. I needed this short tutorial.
    What ya need my signature for? It's not like it's my last will, or something!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •