[Samba] Managing samba ad dc with systemd

Igor Sousa igorvolt at gmail.com
Thu Apr 25 21:31:32 UTC 2019


Hi,

I have a question about samba 4 with systemd. I've followed the "Managing
the Samba AD DC Service Using Systemd" and I've created
/etc/systemd/system/samba-ad-dc.service file with the following 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


I've created a mask to smbd, nmbd and winbind and I've disabled them
following this command: # systemctl mask smbd nmbd winbind # systemctl
disable smbd nmbd winbind. But, when I've use systemctl stop samba-ad-dc to
stop samba, the status shown is "failed" with code=exited and status=127.

Is it normal behavior?

[root at king ~]# systemctl stop samba-ad-dc
[root at king ~]# systemctl status samba-ad-dc
‚óŹ samba-ad-dc.service - Samba Active Directory Domain Controller
   Loaded: loaded (/etc/systemd/system/samba-ad-dc.service; disabled;
vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2019-04-25 17:05:26 -03;
10min ago
  Process: 4937 ExecStart=/usr/local/samba/sbin/samba -D (code=exited,
status=0/SUCCESS)
 Main PID: 4938 (code=exited, status=127)

Apr 25 17:05:19 king smbd[4944]:   daemon_ready: daemon 'smbd' finished
starting up and ready to serve connections
Apr 25 17:05:19 king winbindd[4954]: [2019/04/25 17:05:19.918759,  0]
../../source3/winbindd/winbindd_cache.c:3165(initialize_win...d_cache)
Apr 25 17:05:19 king winbindd[4954]:   initialize_winbindd_cache: clearing
cache and re-creating with version number 2
Apr 25 17:05:19 king winbindd[4954]: [2019/04/25 17:05:19.939054,  0]
../../lib/util/become_daemon.c:136(daemon_ready)
Apr 25 17:05:19 king winbindd[4954]:   daemon_ready: daemon 'winbindd'
finished starting up and ready to serve connections
Apr 25 17:05:25 king systemd[1]: Stopping Samba Active Directory Domain
Controller...
Apr 25 17:05:25 king systemd[1]: samba-ad-dc.service: main process exited,
code=exited, status=127/n/a
Apr 25 17:05:26 king systemd[1]: Stopped Samba Active Directory Domain
Controller.
Apr 25 17:05:26 king systemd[1]: Unit samba-ad-dc.service entered failed
state.
Apr 25 17:05:26 king systemd[1]: samba-ad-dc.service failed.
Hint: Some lines were ellipsized, use -l to show in full.


(
https://wiki.samba.org/index.php/Managing_the_Samba_AD_DC_Service_Using_Systemd
)

--
Igor Sousa


More information about the samba mailing list