summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2014-03-25 12:53:04 +0200
committerJeremy Allison <jra@samba.org>2014-04-23 02:29:08 +0200
commitaa8c8a7b5b062b36a74a505aa48ba7dc5141aa55 (patch)
tree4225d4ca30fdd7b74b66fbd5314f3dd605e43aba /wscript
parent13784b74d84e1351e27702fd3bbfb04eeb9a40f8 (diff)
downloadsamba-aa8c8a7b5b062b36a74a505aa48ba7dc5141aa55.tar.gz
add systemd integration
Add --with-systemd / --without-systemd options to check whether libsystemd-daemon library is available and use it to report service startup status to systemd for smbd/winbindd/nmbd and AD DC. The problem it solves is correct reporting of the Samba services at the point when they are ready to serve clients, important for high availability software integration. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'wscript')
-rw-r--r--wscript26
1 files changed, 23 insertions, 3 deletions
diff --git a/wscript b/wscript
index ae4ff50b6d1..87541da62ce 100644
--- a/wscript
+++ b/wscript
@@ -69,8 +69,15 @@ def set_options(opt):
help=("Disable RELRO builds"),
action="store_false", dest='enable_relro')
- gr = opt.option_group('developer options')
+ opt.add_option('--with-systemd',
+ help=("Enable systemd integration"),
+ action='store_true', dest='enable_systemd')
+
+ opt.add_option('--without-systemd',
+ help=("Disable systemd integration"),
+ action='store_false', dest='enable_systemd')
+ gr = opt.option_group('developer options')
opt.tool_options('python') # options for disabling pyc or pyo compilation
# enable options related to building python extensions
@@ -169,8 +176,6 @@ def configure(conf):
addmain=False,
msg='Checking configure summary'):
raise Utils.WafError('configure summary failed')
-
- conf.SAMBA_CONFIG_H('include/config.h')
if Options.options.enable_pie != False:
if Options.options.enable_pie == True:
@@ -192,6 +197,21 @@ def configure(conf):
msg="Checking compiler for full RELRO support"):
conf.env['ENABLE_RELRO'] = True
+ if Options.options.enable_systemd != False:
+ conf.check_cfg(package='libsystemd-daemon', args='--cflags --libs',
+ msg='Checking for libsystemd-daemon', uselib_store="SYSTEMD-DAEMON")
+ conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd-daemon')
+ conf.CHECK_LIB('systemd-daemon', shlib=True)
+
+ if conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H'):
+ conf.DEFINE('HAVE_SYSTEMD', '1')
+ conf.env['ENABLE_SYSTEMD'] = True
+ else:
+ conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
+ conf.undefine('HAVE_SYSTEMD')
+
+ conf.SAMBA_CONFIG_H('include/config.h')
+
def etags(ctx):
'''build TAGS file using etags'''
import Utils