[PATCH] fix for bug 12293, was fix for bug 12292

Alexander Bokovoy ab at samba.org
Wed Sep 28 21:17:31 UTC 2016


On ke, 28 syys 2016, Rowland Penny wrote:
> > Thanks. Looks good to me. RB+. Can you add another one for the group
> > case as you promised and then I'll push them.
> > 
> 
> Patch attached.
Thanks. The patch is LGTM too.

I'll look at pushing that tomorrow. My local make test fails right now
on Fedora 25 alpha due to wrong libsystemd detection. When I fixed that, 
I've got an error on samba3.base.delaywrite(ad_dc) test (below). Since
these are not related to Python changes, I'll look in the morning in
details.

[329(1744)/1958 at 21m5s] samba3.base.delaywrite(ad_dc)
Running test_delayed_write_update4
Open the file handle
fileinfo: Access(Thu Sep 29 00:07:30 2016 EEST) Write(Thu Sep 29 00:07:30 2016 EEST)
pathinfo: Access(Thu Sep 29 00:07:30 2016 EEST) Write(Thu Sep 29 00:07:30 2016 EEST)
Do a write on the file handle
fileinfo: Access(Thu Sep 29 00:07:30 2016 EEST) Write(Thu Sep 29 00:07:32 2016 EEST)
pathinfo: Access(Thu Sep 29 00:07:30 2016 EEST) Write(Thu Sep 29 00:07:32 2016 EEST)
UNEXPECTED(failure): samba3.base.delaywrite.delayed update of write time 4(ad_dc)
REASON: Exception: Exception:
../source4/torture/basic/delaywrite.c:2186: wrong write_time (finfo1)Thu Sep 29 00:07:32 2016 EEST(131195704520847144) != (finfo0)Thu Sep 29 00:07:30 2016 EEST(131195704503073917)
command: /home/abokovoy/src/samba/bin/smbtorture  $LOADLIST
--configfile=$SMB_CONF_PATH --option='fss:sequence timeout=1'
--maximum-runtime=$SELFTEST_MAXTIME --basedir=$SELFTEST_TMPDIR
--format=subunit --option=torture:progress=no
--option=torture:sharedelay=100000
--option=torture:writetimeupdatedelay=500000 --target=samba3
//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900
//base.delaywrite 2>&1  |
///home/abokovoy/src/samba/selftest/filter-subunit --fail-on-empty
//--prefix="samba3.base.delaywrite." --suffix="(ad_dc)"
expanded command: /home/abokovoy/src/samba/bin/smbtorture  $LOADLIST
--configfile=/home/abokovoy/src/samba/st/client/client.conf
--option='fss:sequence timeout=1' --maximum-runtime=1200
--basedir=/home/abokovoy/src/samba/st/tmp --format=subunit
--option=torture:progress=no --option=torture:sharedelay=100000
--option=torture:writetimeupdatedelay=500000 --target=samba3 //addc/tmp
-UAdministrator%locDCpass1 -k yes --maximum-runtime=900 base.delaywrite
2>&1  | /home/abokovoy/src/samba/selftest/filter-subunit --fail-on-empty
--prefix="samba3.base.delaywrite." --suffix="(ad_dc)"
ERROR: Testsuite[samba3.base.delaywrite(ad_dc)]
REASON: Exit code was 1


-- 
/ Alexander Bokovoy
-------------- next part --------------
>From b721736f405840b7b604c20c56654d92cfef5e66 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <ab at samba.org>
Date: Thu, 29 Sep 2016 00:09:12 +0300
Subject: [PATCH 3/3] systemd: fix detection of libsystemd

On Fedora 25 detection of libsystemd actually fails due to wrong
assumptions in the configure test. conf.CHECK_LIB returns a list
so 'not conf.CHECK_LIB(...)' is always False and we never get to check
libsystemd.

Instead, remember result of checking pkg-config for separate
libsystemd-daemon and libsystemd-journal libraries. If they miss,
attempt to use libsystemd library instead.

Signed-off-by: Alexander Bokovoy <ab at samba.org>
---
 lib/util/wscript_configure | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure
index a1e5801..7c17633 100644
--- a/lib/util/wscript_configure
+++ b/lib/util/wscript_configure
@@ -110,16 +110,17 @@ conf.SET_TARGET_TYPE('systemd-journal', 'EMPTY')
 conf.SET_TARGET_TYPE('systemd', 'EMPTY')
 
 if Options.options.enable_systemd != False:
-    conf.CHECK_CFG(package='libsystemd-daemon', args='--cflags --libs',
+    r_daemon = conf.CHECK_CFG(package='libsystemd-daemon', args='--cflags --libs',
                    msg='Checking for libsystemd-daemon')
-    if not conf.CHECK_LIB('systemd-daemon', shlib=True):
-        conf.CHECK_LIB('systemd', shlib=True)
-
-if Options.options.enable_systemd != False:
-    conf.CHECK_CFG(package='libsystemd-journal', args='--cflags --libs',
+    r_journal = conf.CHECK_CFG(package='libsystemd-journal', args='--cflags --libs',
                    msg='Checking for libsystemd-journal')
-    if not conf.CHECK_LIB('systemd-journal', shlib=True):
+    if r_daemon is None and r_journal is None:
+        conf.CHECK_CFG(package='libsystemd', args='--cflags --libs',
+                   msg='Checking for libsystemd')
         conf.CHECK_LIB('systemd', shlib=True)
+    else:
+        conf.CHECK_LIB('systemd-daemon', shlib=True)
+        conf.CHECK_LIB('systemd-journal', shlib=True)
 
 if Options.options.enable_lttng != False:
     conf.CHECK_CFG(package='lttng-ust', args='--cflags --libs',
-- 
2.9.3



More information about the samba-technical mailing list