1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-scripts: Properly set CTDB_VARDIR in scripts at install time

Have wscript do path substitution.

No need to export this and CTDB_ETCDIR here, but test scripts will
still need to do so.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Martin Schwenke 2015-08-13 15:17:51 +10:00 committed by Michael Adam
parent bd77a9797f
commit d064620f51
4 changed files with 58 additions and 44 deletions

View File

@ -2,16 +2,15 @@
# utility functions for ctdb event scripts
[ -z "$CTDB_VARDIR" ] && {
if [ -d "/var/lib/ctdb" ] ; then
export CTDB_VARDIR="/var/lib/ctdb"
else
export CTDB_VARDIR="/var/ctdb"
# Only (and always) override these variables in test code
if [ -z "$CTDB_VARDIR" ] ; then
CTDB_VARDIR="/usr/local/var/lib/ctdb"
fi
if [ -z "$CTDB_ETCDIR" ] ; then
CTDB_ETCDIR="/etc"
fi
}
[ -z "$CTDB_ETCDIR" ] && {
export CTDB_ETCDIR="/etc"
}
#######################################
# pull in a system config file, if any

View File

@ -72,7 +72,7 @@
should not be stored on the shared cluster filesystem.
</para>
<para>
This directory would usually be <filename>/var/lib/ctdb</filename>
Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
</para>
</listitem>
</varlistentry>
@ -87,8 +87,7 @@
filesystem.
</para>
<para>
This directory would usually be
<filename>/var/lib/ctdb/persistent</filename>
Defaults to <filename>/usr/local/var/lib/ctdb/persistent</filename>.
</para>
</listitem>
</varlistentry>
@ -102,8 +101,7 @@
should not be stored on the shared cluster filesystem.
</para>
<para>
This directory would usually be
<filename>/var/lib/ctdb/state</filename>
Defaults to <filename>/usr/local/var/lib/ctdb/state</filename>.
</para>
</listitem>
</varlistentry>

View File

@ -114,9 +114,7 @@
runtime.
</para>
<para>
Defaults to <filename>/var/ctdb</filename>, unless
<filename>/var/lib/ctdb</filename> already exists in which
case it is used.
Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
</para>
</listitem>
</varlistentry>
@ -172,8 +170,10 @@
<term>CTDB_DBDIR=<parameter>DIRECTORY</parameter></term>
<listitem>
<para>
Defaults to <varname>CTDB_VARDIR</varname>. Corresponds to
<option>--dbdir</option>.
Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
</para>
<para>
Corresponds to <option>--dbdir</option>.
</para>
</listitem>
</varlistentry>
@ -182,7 +182,9 @@
<term>CTDB_DBDIR_PERSISTENT=<parameter>DIRECTORY</parameter></term>
<listitem>
<para>
Defaults to <varname>CTDB_VARDIR</varname>/persistent.
Defaults to <filename>/usr/local/var/lib/ctdb/persistent</filename>.
</para>
<para>
Corresponds to <option>--dbdir-persistent</option>.
</para>
</listitem>
@ -192,7 +194,9 @@
<term>CTDB_DBDIR_STATE=<parameter>DIRECTORY</parameter></term>
<listitem>
<para>
Defaults to <varname>CTDB_VARDIR</varname>/state.
Defaults to <filename>/usr/local/var/lib/ctdb/state</filename>.
</para>
<para>
Corresponds to <option>--dbdir-state</option>.
</para>
</listitem>

View File

@ -36,6 +36,19 @@ samba_dist.DIST_DIRS('''ctdb:. lib/replace:lib/replace lib/talloc:lib/talloc
lib/ccan:lib/ccan libcli/util:libcli/util
buildtools:buildtools third_party/waf:third_party/waf''')
manpages = [
'ctdb.1',
'ctdb.7',
'ctdbd.1',
'ctdbd.conf.5',
'ctdbd_wrapper.1',
'ctdb-statistics.7',
'ctdb-tunables.7',
'ltdbtool.1',
'onnode.1',
'ping_pong.1'
]
def set_options(opt):
opt.PRIVATE_EXTENSION_DEFAULT('ctdb')
@ -356,7 +369,7 @@ def build(bld):
ctdb-common-util ctdb-system ctdb-tcp''' +
ib_deps,
install_path='${SBINDIR}',
manpages='doc/ctdbd.1')
manpages='ctdbd.1')
bld.SAMBA_BINARY('ctdb',
source='tools/ctdb.c tools/ctdb_vacuum.c',
@ -364,14 +377,14 @@ def build(bld):
ctdb-system''',
includes='include include/internal',
install_path='${BINDIR}',
manpages='doc/ctdb.1')
manpages='ctdb.1')
bld.SAMBA_BINARY('ltdbtool',
source='tools/ltdbtool.c',
includes='include',
deps='tdb',
install_path='${BINDIR}',
manpages='doc/ltdbtool.1')
manpages='ltdbtool.1')
bld.SAMBA_BINARY('ctdb_lock_helper',
source='server/ctdb_lock_helper.c',
@ -413,7 +426,7 @@ def build(bld):
source='utils/ping_pong/ping_pong.c',
deps='',
install_path='${BINDIR}',
manpages='doc/ping_pong.1')
manpages='ping_pong.1')
if bld.env.HAVE_PMDA:
bld.SAMBA_BINARY('pmdactdb',
@ -435,9 +448,19 @@ def build(bld):
bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/README',
destname='README')
sed_expr1 = 's|/usr/local/var/lib/ctdb|%s|g' % (bld.env.CTDB_VARDIR)
sed_cmdline = '-e "%s"' % (sed_expr1)
for f in manpages:
x = '%s.xml' % (f)
bld.SAMBA_GENERATOR(x,
source=os.path.join('doc', x),
target=x,
rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
bld.MANPAGES('''doc/onnode.1 doc/ctdbd_wrapper.1 doc/ctdbd.conf.5
doc/ctdb.7 doc/ctdb-statistics.7 doc/ctdb-tunables.7''',
bld.MANPAGES('''onnode.1 ctdbd_wrapper.1 ctdbd.conf.5
ctdb.7 ctdb-statistics.7 ctdb-tunables.7''',
True)
bld.INSTALL_FILES('${BINDIR}', 'tools/onnode',
@ -478,8 +501,11 @@ def build(bld):
bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % fmode[0],
destname=fmode[0], chmod=fmode[1])
bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/functions',
destname='functions')
bld.SAMBA_GENERATOR('ctdb-functions',
source='config/functions',
target='functions',
rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'functions', destname='functions')
etc_scripts = [
'ctdb-crash-cleanup.sh',
@ -689,19 +715,6 @@ def dist():
sys.exit(ret)
samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True)
manpages = [
'ctdb.1',
'ctdb.7',
'ctdbd.1',
'ctdbd.conf.5',
'ctdbd_wrapper.1',
'ctdb-statistics.7',
'ctdb-tunables.7',
'ltdbtool.1',
'onnode.1',
'ping_pong.1'
]
cmd = 'make -C doc'
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0: