7

OS: Debian 12 (bookworm)

When I try to start samba, systemctl start samba runs with no output, but systemctl status samba outputs:

* samba-ad-dc.service - Samba AD Daemon
     Loaded: loaded (/lib/systemd/system/samba-ad-dc.service; enabled; preset: enabled)
     Active: inactive (dead) (Result: exec-condition) since Wed 2023-08-30 19:35:52 CEST; 10s ago
  Condition: start condition failed at Wed 2023-08-30 19:35:52 CEST; 10s ago
       Docs: man:samba(8)
             man:samba(7)
             man:smb.conf(5)
    Process: 1414 ExecCondition=/usr/share/samba/is-configured samba (code=exited, status=1/FAILURE)
        CPU: 26ms

Aug 30 19:35:52 debian-srv systemd[1]: Starting samba-ad-dc.service - Samba AD Daemon...
Aug 30 19:35:52 debian-srv systemd[1]: samba-ad-dc.service: Skipped due to 'exec-condition'.
Aug 30 19:35:52 debian-srv systemd[1]: Condition check resulted in samba-ad-dc.service - Samba AD Daemon being skipped.

testparm doesn't return any errors in the smb.conf file.

log.smbd:

[2023/08/30 19:31:50.587835,  0] ../../source3/smbd/server.c:1741(main)
  smbd version 4.17.10-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022

log.nmbd:

[2023/08/30 19:31:49.882020,  0] ../../source3/nmbd/nmbd.c:901(main)
  nmbd version 4.17.10-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022
[2023/08/30 19:32:12.939108,  0] ../../source3/nmbd/nmbd_become_lmb.c:398(become_local_master_stage2)
  *****
  
  Samba name server DEBIAN-SRV is now a local master browser for workgroup WORKGROUP on subnet 192.168.0.110
  
  *****

I tried reinstalling the system, but the problem still persists.

1
  • Did you eve get around this? I'm stuck exactly as you were :( Commented Jan 20 at 17:16

1 Answer 1

4

If you did not set up Samba to be an "active directory domain controller" (e.g. as described here), then I think this is expected behaviour.

The confusing thing is that the systemd samba service is actually an alias for the samba-ad-dc service:

root@server:/# ls -l /lib/systemd/system/ | grep samba
-rw-r--r-- 1 root root  464 Oct 10 17:17 samba-ad-dc.service
lrwxrwxrwx 1 root root   19 Oct 10 17:17 samba.service -> samba-ad-dc.service

In the systemd status output you can observe that the service file has an execution condition that invokes /usr/share/samba/is-configured samba. If you take a look at this script you will find that it reads your samba config using testparm to find if the server role parameter equals "active directory domain controller". If not, it exits with a return code of 1 (failure), hence the failure to start the samba-ad-dc service.

The actual systemd service controlling the Samba server is smbd.service.

1
  • @sbivcy any fix for this. I encountered the same issue in Debian Bookworm, XFCE. Commented Jun 20 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.