[
    {
        "role": "user",
        "content": "trying%20to%20start%20smbd%20on%20debian%2012%20getting%20skipped%20due%20to%20%27exec%27%20condition"
    },
    {
        "role": "assistant",
        "content": "If you're seeing an error like this when trying to start `smbd` or the `samba` service on Debian 12 (Bookworm):\n\n```\nsmbd.service: Skipped due to 'exec-condition'\n```\n\n\u2026or similar messages for `samba-ad-dc.service`, here\u2019s what this means\u2014and how to fix it.\n\n---\n\n## What \"Skipped due to 'exec-condition'\" Means\n\nSystemd supports the `ExecCondition=` directive, which runs a command before attempting to start a service. If this command exits with a non-zero code (in the range 1\u2013254), systemd skips starting the service\u2014but doesn\u2019t mark it as failed. If it exits with 0 (or a code listed in `SuccessExitStatus=`), systemd continues. ([manpages.debian.org](https://manpages.debian.org/bookworm/systemd/systemd.service.5.en.html?utm_source=openai))\n\nIn Debian 12\u2019s Samba setup:\n\n- The `samba-ad-dc.service` (and its alias `samba.service`) has a condition set via `ExecCondition=/usr/share/samba/is-configured samba`. ([stackoverflow.com](https://stackoverflow.com/questions/77010547/samba-ad-dc-service-skipped-due-to-exec-condition?utm_source=openai))  \n- The `is-configured` script checks your Samba configuration (mainly `smb.conf`) to see if `server role = active directory domain controller` is set. If not, it exits with status 1 and causes the service to be skipped. ([stackoverflow.com](https://stackoverflow.com/questions/77010547/samba-ad-dc-service-skipped-due-to-exec-condition?utm_source=openai))\n\nTherefore, seeing \u201cSkipped due to exec-condition\u201d for `samba-ad-dc.service` usually means you aren\u2019t running Samba in AD Domain Controller mode\u2014and that\u2019s expected behaviour. Maintenance of the services `smbd.service` or `nmbd.service` usually covers file sharing roles. ([stackoverflow.com](https://stackoverflow.com/questions/77010547/samba-ad-dc-service-skipped-due-to-exec-condition?utm_source=openai))\n\n---\n\n## How to Use the Correct Service vs. AD\n\n### For File Sharing (Standalone Server)\n\nIf all you need is file sharing, you should:\n\n- Use `smbd.service` (SMB daemon)\n- Possibly also `nmbd.service` (NetBIOS name service) or `winbind.service` if needed\n\nTo enable and start the file server functionality:\n\n```bash\nsudo systemctl enable smbd.service\nsudo systemctl start smbd.service\nsudo systemctl status smbd.service\n```\n\nCheck if `smbd` starts cleanly\u2014`/usr/share/samba/is-configured smb` should return status 0. ([reddit.com](https://www.reddit.com/r/debian/comments/186ctpb?utm_source=openai))\n\n### If You Want AD Domain Controller\n\nIf your intention *is* to have Samba act as an AD DC, you need:\n\n1. In `/etc/samba/smb.conf` under `[global]`, set:\n\n   ```\n   server role = active directory domain controller\n   ```\n\n2. Run provisioning (if not already done):\n\n   ```bash\n   sudo samba-tool domain provision --...   # etc.\n   ```\n\n3. Enable and start `samba-ad-dc.service` (or `samba.service` as alias). After setting the role, `is-configured` should exit status 0. ([stackoverflow.com](https://stackoverflow.com/questions/77010547/samba-ad-dc-service-skipped-due-to-exec-condition?utm_source=openai))\n\n---\n\n## Things to Check / Troubleshoot\n\nIf `smbd` is still skipped or AD stuff doesn\u2019t change:\n\n- Run:\n\n  ```bash\n  /usr/share/samba/is-configured smb\n  echo $?\n  ```\n\n  Should be `0` if `smbd` is allowed to run. If it\u2019s `1`, inspect your `smb.conf`. ([reddit.com](https://www.reddit.com/r/debian/comments/186ctpb?utm_source=openai))\n\n- Make sure `smb.conf` is in `/etc/samba/`; it's often not installed automatically, or overwritten/upgraded. Use `testparm` to verify its syntax. ([reddit.com](https://www.reddit.com/r/debian/comments/15673pd?utm_source=openai))\n\n- Check permissions and content of `/usr/share/samba/is-configured`. It must be executable; it reads `smb.conf`. If `smb.conf` has syntax errors, misnamed path, or missing `server role=\u2026`, the test will fail. ([stackoverflow.com](https://stackoverflow.com/questions/77010547/samba-ad-dc-service-skipped-due-to-exec-condition?utm_source=openai))\n\n---\n\n## Summary\n\n| Scenario | Expected Service | Why \u201cexec-condition skipped\u201d Appears |\n|---|---|---|\n| Just file shares | `smbd` (and optionally `nmbd`) | `samba-ad-dc.service` is skipped because you're *not* configuring Samba as an AD DC\u2014expected behaviour. |\n| AD Domain Controller | `samba-ad-dc.service` (alias `samba.service`) | Will run only if `server role = active directory domain controller` is set; otherwise it's skipped. |\n\n---\n\nIf you like, I can walk you through your specific `smb.conf`\u2014you can paste the `[global]` section (mask private info) and I can help spot exactly why `is-configured` is failing on your setup."
    }
]