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:
Add this Upstart script inside:
sudo nano /etc/init/samba4.conf
Save and exit
description "SMB/CIFS File and Active Directory Server"
author "Jelmer Vernooij "
start on (local-filesystems and net-device-up)
stop on runlevel [!2345]
normal exit 0
[ -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
exec /usr/local/samba/sbin/samba -D
then execute those commands:
chmod 755 /etc/init/samba4.conf
chmod +x /etc/init/samba4.conf
Now your samba server should start automatically at reboot.