From: Martin Schwenke Date: Sat, 7 Jul 2018 05:23:27 +0000 (+1000) Subject: ctdb-build: Enable some standard event scripts if none are enabled X-Git-Tag: tevent-0.9.37~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0937ce04222ee726a2ca7d87e3b2bf176b883340;p=thirdparty%2Fsamba.git ctdb-build: Enable some standard event scripts if none are enabled CTDB needs the legacy/00.ctdb event script to be able to function properly. If this script is not enabled then assume a first-time install or an upgrade to a version that requires events scripts to be enabled via symlinks. In these cases enable this script and other commonly used scripts. Only do this for a direct install. If DESTDIR is being used then assume a package is being built and let the packager handle this case. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/wscript b/ctdb/wscript index d306cb67e78..73fd5bd3d00 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -786,6 +786,25 @@ def build(bld): bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % fmode[0], destname=fmode[0], chmod=fmode[1]) + # If this is a direct install and there are no event scripts + # linked/enabled then enable some standard ones + if os.environ.get('DESTDIR') is None: + fmt = 'events/legacy/%s.script' + required_script = '00.ctdb' + required_path = os.path.join(bld.env.CTDB_ETCDIR, + fmt % (required_script)) + if not os.path.islink(required_path) and \ + not os.path.exists(required_path): + default_scripts = [ required_script, + '01.reclock', + '05.system', + '10.interface', + ] + for t in default_scripts: + tgt = os.path.join(bld.env.CTDB_DATADIR, fmt % (t)) + name = os.path.join(bld.env.CTDB_ETCDIR, fmt % (t)) + bld.symlink_as(name, tgt) + bld.SAMBA_GENERATOR('ctdb-functions', source='config/functions', target='functions',