2016-07-10 2:12 GMT+02:00 Andrew Bartlett <abartlet at samba.org>:> On Sat, 2016-07-09 at 11:27 +0200, Marc Muehlfeld wrote: > > Hello, > > > > Am 09.07.2016 um 09:14 schrieb Rowland penny: > > > > What is the purpose of the option > > > > * > > > > **--with-**systemd** > > > > ****Enable****systemd****integration* > > > > > > > > To configure Samba (build). > > > > > > > > > [removed troll]> > Carlos, it's a good question. I really never recognized this option. > > > > What is different afterwards when using with/without? Does it create > > a > > systemd service file? > > It just means we link to a small library that helps systemd know that > we started up successfully, as I understand it. > > This is needed because of the way we double-fork() at startup, so the > original PID values from the process that called exec() is not the long > -term PID. >Andrew, 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. I ask because we are using last Samba and systemd (in version 219 today on Centos7), we are using shipped systemd unit files (or at least I expect that's Samba which create them, not the .spec / rpmbuild tool) and service samba-ad works well when samba-smbd, samba-nmdb and samba-winbindd are all three killed by systemd after timeout. Of course Samba works well, running these daemons just calling their names is sufficient for the service starts well. I did add --with-systemd to our .spec, compiled a 4.4.5, tested it as file server and same issue: systemd refuses to understand these processes are working and kill after some time. Checking logs of that compilation I get: ... Checking for libsystemd-daemon : not found Checking for library systemd-daemon : no Checking for library systemd-libs : no Checking for libsystemd-journal : not found Checking for library systemd-journal : no Checking for library systemd : no ... when rpm -qa systemd* systemd-libs-219-19.el7_2.9.x86_64 systemd-219-19.el7_2.9.x86_64 systemd-sysv-219-19.el7_2.9.x86_64 systemd-python-219-19.el7_2.9.x86_64 It looks to me that configure script can't find Centos 7 systemd installation files. Any idea of what I would have missed? Cheers, mathias
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
On Tue, Jul 12, 2016 at 8:11 AM, mathias dufresne <infractory at gmail.com> wrote:> It looks to me that configure script can't find Centos 7 systemd > installation files. Any idea of what I would have missed?Same issues with Debian Jessie - nothing you missed. Apparently libsystemd-daemon and libsystemd-journal are deprecated and merged into a single libsystemd file (must have happened some time ago since Debian has the change). It appears that Samba does not check for libsystemd (only libsystemd-daemon and libsystemd-journal) during the config phase so unless one is running some ancient version of systemd the "--with-systemd" configure option may be quite useless. Chris
\o/ Martin, thank you very much : ) Our unit files were configured with "Type=forking". I just changed that to replace it by "Type=notify" and these unit files are starting all three daemons (nmbd, smbd, winbindd) without killing them after some time. I did tried that change in our unit files on others servers, with older Samba version compiled without --with-systemd and changing type to notify was also enough on these systems. I expect the issue raised because our deployment script should push these unit files rather than using those build during packaging (perhaps they are built only when using --with-systemd, not tested yet). Thank you all for that : ) 2016-07-12 15:10 GMT+02:00 martin <martini5468 at gmail.com>:> 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 >
On Tue, Jul 12, 2016 at 9:32 AM, Sonic <sonicsmith at gmail.com> wrote:> It appears that Samba does not check for > libsystemd (only libsystemd-daemon and libsystemd-journal) during the > config phase so unless one is running some ancient version of systemd > the "--with-systemd" configure option may be quite useless.Might be wrong on this, see the ../lib/util/wscript_configure script in the src. It looks like it may search for libsystemd after libsystemd-daemon and libsystemd-journal, but in my case it doesn't find that either, possibly as I'm building in a container. Chris
Am 12.07.2016 um 15:32 schrieb Sonic:> On Tue, Jul 12, 2016 at 8:11 AM, mathias dufresne <infractory at gmail.com> wrote: >> It looks to me that configure script can't find Centos 7 systemd >> installation files. Any idea of what I would have missed? > Same issues with Debian Jessie - nothing you missed. Apparently > libsystemd-daemon and libsystemd-journal are deprecated and merged > into a single libsystemd file (must have happened some time ago since > Debian has the change). It appears that Samba does not check for > libsystemd (only libsystemd-daemon and libsystemd-journal) during the > config phase so unless one is running some ancient version of systemd > the "--with-systemd" configure option may be quite useless. > > Chris >You also need the libsystemd-dev if you build samba manual.
Seemingly Similar Threads
- RNDC errors using SAMBA_INTERNAL_DNS
- Samba 4 compilation - required libraries and programs for compilation on OpenSuse Leap 42.1
- samba 4.4rcx WINS nsswitch module
- Samba 4 compilation - required libraries and programs for compilation on OpenSuse Leap 42.1
- Building on debian 8.6