F5F Stay Refreshed Software Operating Systems Samba version 4.22 compiled from source on Ubuntu Server 24.10 encountered issues starting.

Samba version 4.22 compiled from source on Ubuntu Server 24.10 encountered issues starting.

Samba version 4.22 compiled from source on Ubuntu Server 24.10 encountered issues starting.

E
ExodusMC
Member
146
09-01-2024, 11:23 AM
#1
I’m preparing Samba 4.22 as an active directory domain controller on Ubuntu Server 24.10. I’m testing by building samba from source and setting it up. I’ve followed the steps outlined in my guide, such as verifying that the /etc/hosts file on the DC matches the FQDN with the correct LAN IP. I also updated the PATH in the profile to include the Samba binaries. When trying to launch the service via systemctl, it fails with an error. I’m checking logs and ports but need guidance on possible misconfigurations. I’ve compiled with debugging enabled before, yet it still doesn’t start properly. Could someone advise if there’s an issue with the setup or configuration?
E
ExodusMC
09-01-2024, 11:23 AM #1

I’m preparing Samba 4.22 as an active directory domain controller on Ubuntu Server 24.10. I’m testing by building samba from source and setting it up. I’ve followed the steps outlined in my guide, such as verifying that the /etc/hosts file on the DC matches the FQDN with the correct LAN IP. I also updated the PATH in the profile to include the Samba binaries. When trying to launch the service via systemctl, it fails with an error. I’m checking logs and ports but need guidance on possible misconfigurations. I’ve compiled with debugging enabled before, yet it still doesn’t start properly. Could someone advise if there’s an issue with the setup or configuration?

M
143
09-01-2024, 12:23 PM
#2
I've updated the instructions and tested them once more. It’s now working properly: sudo apt-get install acl attr autoconf bind9utils bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls28-dev libgpgme-dev libjson-perl libldap2-dev libncurses-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev nettle-dev perl pkg-config python3-dev python3-dbg python3-cryptography python3-dnspython python3-gpg python3-markdown xsltproc zlib1g-dev liblmdb-dev lmdb-utils libdbus-1-dev libtasn1-bin glib-2.0 libsystemd-dev net-tools plocate Ensure the /etc/hosts file on the DC correctly maps the fully-qualified domain name (FQDN) to the LAN IP of the DC. For instance: 192.168.1.100 dc01.mimosa.home dc01 dcadmin@dc01. Test with ping: ping dc01 PING dc01.mimosa.home (192.168.1.100) 56(84) bytes of data. 64 bytes from dc01.mimosa.home (192.168.1.100): icmp_seq=1 ttl=64 time=5.63 ms 64 bytes from dc01.mimosa.home (192.168.1.100): icmp_seq=2 ttl=64 time=1.01 ms 64 bytes from dc01.mimosa.home (192.168.1.100): icmp_seq=3 ttl=64 time=1.14 ms Download TAR.GZ from samba.org wget https://download.samba.org/pub/samba/sta...2.1.tar.gz tar -zxf samba-4.22.1.tar.gz cd samba-4.22.1 ./configure make make install /usr/local/samba sudo nano /etc/profile export PATH=/usr/local/samba/bin/:/usr/local/samba/sbin/:$PATH Add path to samba tools in sudoers secure path /etc/sudoers Provision the domain: sudo samba-tool domain provision --use-rfc2307 --interactive Overwrite the KRB5 config file with one generated by SAMBA: sudo cp /usr/local/samba/private/krb5.conf /etc/krb5.conf Fix DNS setup: sudo resolvectl dns enp0s3 192.168.1.100 sudo resolvectl domain enp0s3 mimosa.home Stop systemd-resolved from handling DNS: sudo systemctl disable systemd-resolved.service sudo service systemd-resolved stop Create the /etc/systemd/system/samba-ad-dc.service file with this content: [Unit] Description=Samba Active Directory Domain Controller After=network.target remote-fs.target nss-lookup.target [Service] Type=forking ExecStart=/usr/local/samba/sbin/samba -D PIDFile=/usr/local/samba/var/run/samba.pid ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target sudo systemctl enable samba-ad-dc sudo systemctl start samba-ad-dc dcadmin@dc01:~/samba-4.22.1$ sudo systemctl status samba-ad-dc ● samba-ad-dc.service - Samba Active Directory Domain Controller Loaded: loaded (/etc/systemd/system/samba-ad-dc.service; enabled; preset: enabled) Active: active (running) since Fri 2025-04-18 10:52:25 UTC; 8s ago Invocation: 410e7977cfb544249a12e676fe185dcb Process: 34208 ExecStart=/usr/local/samba/sbin/samba -D (code=exited, status=0/SUCCESS) Main PID: 34209 (samba) Tasks: 59 (limit: 6235) Memory: 180.3M (peak: 264M) CPU: 2.143s It’s great! I’m still waiting to reboot and verify if the resolvctl commands permanently change the DNS settings on the interface, and that Samba boots successfully during startup. I’ll give it another try next time.
M
meetspore83619
09-01-2024, 12:23 PM #2

I've updated the instructions and tested them once more. It’s now working properly: sudo apt-get install acl attr autoconf bind9utils bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls28-dev libgpgme-dev libjson-perl libldap2-dev libncurses-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev nettle-dev perl pkg-config python3-dev python3-dbg python3-cryptography python3-dnspython python3-gpg python3-markdown xsltproc zlib1g-dev liblmdb-dev lmdb-utils libdbus-1-dev libtasn1-bin glib-2.0 libsystemd-dev net-tools plocate Ensure the /etc/hosts file on the DC correctly maps the fully-qualified domain name (FQDN) to the LAN IP of the DC. For instance: 192.168.1.100 dc01.mimosa.home dc01 dcadmin@dc01. Test with ping: ping dc01 PING dc01.mimosa.home (192.168.1.100) 56(84) bytes of data. 64 bytes from dc01.mimosa.home (192.168.1.100): icmp_seq=1 ttl=64 time=5.63 ms 64 bytes from dc01.mimosa.home (192.168.1.100): icmp_seq=2 ttl=64 time=1.01 ms 64 bytes from dc01.mimosa.home (192.168.1.100): icmp_seq=3 ttl=64 time=1.14 ms Download TAR.GZ from samba.org wget https://download.samba.org/pub/samba/sta...2.1.tar.gz tar -zxf samba-4.22.1.tar.gz cd samba-4.22.1 ./configure make make install /usr/local/samba sudo nano /etc/profile export PATH=/usr/local/samba/bin/:/usr/local/samba/sbin/:$PATH Add path to samba tools in sudoers secure path /etc/sudoers Provision the domain: sudo samba-tool domain provision --use-rfc2307 --interactive Overwrite the KRB5 config file with one generated by SAMBA: sudo cp /usr/local/samba/private/krb5.conf /etc/krb5.conf Fix DNS setup: sudo resolvectl dns enp0s3 192.168.1.100 sudo resolvectl domain enp0s3 mimosa.home Stop systemd-resolved from handling DNS: sudo systemctl disable systemd-resolved.service sudo service systemd-resolved stop Create the /etc/systemd/system/samba-ad-dc.service file with this content: [Unit] Description=Samba Active Directory Domain Controller After=network.target remote-fs.target nss-lookup.target [Service] Type=forking ExecStart=/usr/local/samba/sbin/samba -D PIDFile=/usr/local/samba/var/run/samba.pid ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target sudo systemctl enable samba-ad-dc sudo systemctl start samba-ad-dc dcadmin@dc01:~/samba-4.22.1$ sudo systemctl status samba-ad-dc ● samba-ad-dc.service - Samba Active Directory Domain Controller Loaded: loaded (/etc/systemd/system/samba-ad-dc.service; enabled; preset: enabled) Active: active (running) since Fri 2025-04-18 10:52:25 UTC; 8s ago Invocation: 410e7977cfb544249a12e676fe185dcb Process: 34208 ExecStart=/usr/local/samba/sbin/samba -D (code=exited, status=0/SUCCESS) Main PID: 34209 (samba) Tasks: 59 (limit: 6235) Memory: 180.3M (peak: 264M) CPU: 2.143s It’s great! I’m still waiting to reboot and verify if the resolvctl commands permanently change the DNS settings on the interface, and that Samba boots successfully during startup. I’ll give it another try next time.