[Samba] Option configure

martin martini5468 at gmail.com
Tue Jul 12 13:10:02 UTC 2016


On Tue 12/07/2016 13:11, mathias dufresne wrote:
> I expect the --with-systemd is to add the little piece of code which makes
> Samba systemd unit files to work correctly, for systemd stop killing
> processes after some timeout because it doesn't received the right message
> from Samba.

Hi Mathias,

A while back we built a test system to try the 4.3 and later packages
and had the same issue. We configured samba with:
"./configure --without-ad-dc --with-systemd --disable-cups
--libdir=/usr/lib64 --prefix=/usr --sysconfdir=/etc --localstatedir=/var
--with-piddir=/var/run --with-sockets-dir=/run --enable-fhs"

After the package build we had a few .service files - I guess as a
result of the --with-systemd switch.

The content of the nmb.service file is:
[Unit]
Description=Samba NMB Daemon
After=syslog.target network.target

[Service]
Type=notify
NotifyAccess=all
PIDFile=/run/nmbd.pid
EnvironmentFile=-/etc/sysconfig/samba
ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

We then replaced the current .service files on the system with the ones
from the compiled package. However doing
systemctl restart nmb smb winbind

would cause each service to start and then die after a little while.
Increasing the verbosity just showed the process getting a SIGHUP.
Looking into systemd it seemed to think the process did not start at all.

After some poking around the web [1] we took the original systemd files
that ship with CentOS 7.2 and changed the .service files for nmb, smb
and winbind to be:
Type=forking

While leaving the rest of the content of the file as is. This has
resolved the issue with service control using systemd.

I hope that might give you an idea of what your problem may be.

Regards,
Martin
References:
[1]
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Unit_Files.html



More information about the samba mailing list