diff options
author | Martin Schwenke <martin@meltin.net> | 2018-07-07 15:23:27 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-07-11 11:48:38 +0200 |
commit | 0937ce04222ee726a2ca7d87e3b2bf176b883340 (patch) | |
tree | 79acdd636285874e4c4c318f1899b1bd559f44c6 /ctdb/wscript | |
parent | 06be1c8593fc84068896b428bdc39e7033bd85e2 (diff) | |
download | samba-0937ce04222ee726a2ca7d87e3b2bf176b883340.tar.gz |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/wscript')
-rw-r--r-- | ctdb/wscript | 19 |
1 files changed, 19 insertions, 0 deletions
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', |