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

View File

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

View File

@ -114,9 +114,7 @@
runtime. runtime.
</para> </para>
<para> <para>
Defaults to <filename>/var/ctdb</filename>, unless Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
<filename>/var/lib/ctdb</filename> already exists in which
case it is used.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -172,8 +170,10 @@
<term>CTDB_DBDIR=<parameter>DIRECTORY</parameter></term> <term>CTDB_DBDIR=<parameter>DIRECTORY</parameter></term>
<listitem> <listitem>
<para> <para>
Defaults to <varname>CTDB_VARDIR</varname>. Corresponds to Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
<option>--dbdir</option>. </para>
<para>
Corresponds to <option>--dbdir</option>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -182,7 +182,9 @@
<term>CTDB_DBDIR_PERSISTENT=<parameter>DIRECTORY</parameter></term> <term>CTDB_DBDIR_PERSISTENT=<parameter>DIRECTORY</parameter></term>
<listitem> <listitem>
<para> <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>. Corresponds to <option>--dbdir-persistent</option>.
</para> </para>
</listitem> </listitem>
@ -192,7 +194,9 @@
<term>CTDB_DBDIR_STATE=<parameter>DIRECTORY</parameter></term> <term>CTDB_DBDIR_STATE=<parameter>DIRECTORY</parameter></term>
<listitem> <listitem>
<para> <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>. Corresponds to <option>--dbdir-state</option>.
</para> </para>
</listitem> </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 lib/ccan:lib/ccan libcli/util:libcli/util
buildtools:buildtools third_party/waf:third_party/waf''') 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): def set_options(opt):
opt.PRIVATE_EXTENSION_DEFAULT('ctdb') opt.PRIVATE_EXTENSION_DEFAULT('ctdb')
@ -356,7 +369,7 @@ def build(bld):
ctdb-common-util ctdb-system ctdb-tcp''' + ctdb-common-util ctdb-system ctdb-tcp''' +
ib_deps, ib_deps,
install_path='${SBINDIR}', install_path='${SBINDIR}',
manpages='doc/ctdbd.1') manpages='ctdbd.1')
bld.SAMBA_BINARY('ctdb', bld.SAMBA_BINARY('ctdb',
source='tools/ctdb.c tools/ctdb_vacuum.c', source='tools/ctdb.c tools/ctdb_vacuum.c',
@ -364,14 +377,14 @@ def build(bld):
ctdb-system''', ctdb-system''',
includes='include include/internal', includes='include include/internal',
install_path='${BINDIR}', install_path='${BINDIR}',
manpages='doc/ctdb.1') manpages='ctdb.1')
bld.SAMBA_BINARY('ltdbtool', bld.SAMBA_BINARY('ltdbtool',
source='tools/ltdbtool.c', source='tools/ltdbtool.c',
includes='include', includes='include',
deps='tdb', deps='tdb',
install_path='${BINDIR}', install_path='${BINDIR}',
manpages='doc/ltdbtool.1') manpages='ltdbtool.1')
bld.SAMBA_BINARY('ctdb_lock_helper', bld.SAMBA_BINARY('ctdb_lock_helper',
source='server/ctdb_lock_helper.c', source='server/ctdb_lock_helper.c',
@ -413,7 +426,7 @@ def build(bld):
source='utils/ping_pong/ping_pong.c', source='utils/ping_pong/ping_pong.c',
deps='', deps='',
install_path='${BINDIR}', install_path='${BINDIR}',
manpages='doc/ping_pong.1') manpages='ping_pong.1')
if bld.env.HAVE_PMDA: if bld.env.HAVE_PMDA:
bld.SAMBA_BINARY('pmdactdb', bld.SAMBA_BINARY('pmdactdb',
@ -435,10 +448,20 @@ def build(bld):
bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/README', bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/README',
destname='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']: if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
bld.MANPAGES('''doc/onnode.1 doc/ctdbd_wrapper.1 doc/ctdbd.conf.5 bld.MANPAGES('''onnode.1 ctdbd_wrapper.1 ctdbd.conf.5
doc/ctdb.7 doc/ctdb-statistics.7 doc/ctdb-tunables.7''', ctdb.7 ctdb-statistics.7 ctdb-tunables.7''',
True) True)
bld.INSTALL_FILES('${BINDIR}', 'tools/onnode', bld.INSTALL_FILES('${BINDIR}', 'tools/onnode',
destname='onnode', chmod=0755) destname='onnode', chmod=0755)
@ -478,8 +501,11 @@ def build(bld):
bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % fmode[0], bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % fmode[0],
destname=fmode[0], chmod=fmode[1]) destname=fmode[0], chmod=fmode[1])
bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/functions', bld.SAMBA_GENERATOR('ctdb-functions',
destname='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 = [ etc_scripts = [
'ctdb-crash-cleanup.sh', 'ctdb-crash-cleanup.sh',
@ -689,19 +715,6 @@ def dist():
sys.exit(ret) sys.exit(ret)
samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True) 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' cmd = 'make -C doc'
ret = samba_utils.RUN_COMMAND(cmd) ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0: if ret != 0: