diff --git a/ctdb/config/functions b/ctdb/config/functions
index 66140dc1aa0..9711c516dee 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -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"
- fi
-}
-[ -z "$CTDB_ETCDIR" ] && {
- export CTDB_ETCDIR="/etc"
-}
+# 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
#######################################
# pull in a system config file, if any
diff --git a/ctdb/doc/ctdbd.1.xml b/ctdb/doc/ctdbd.1.xml
index 7a3844bafde..8f6b7c9ac5f 100644
--- a/ctdb/doc/ctdbd.1.xml
+++ b/ctdb/doc/ctdbd.1.xml
@@ -72,7 +72,7 @@
should not be stored on the shared cluster filesystem.
- This directory would usually be /var/lib/ctdb
+ Defaults to /usr/local/var/lib/ctdb.
@@ -87,8 +87,7 @@
filesystem.
- This directory would usually be
- /var/lib/ctdb/persistent
+ Defaults to /usr/local/var/lib/ctdb/persistent.
@@ -102,8 +101,7 @@
should not be stored on the shared cluster filesystem.
- This directory would usually be
- /var/lib/ctdb/state
+ Defaults to /usr/local/var/lib/ctdb/state.
diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml
index f45c724f4b5..da2471e8e29 100644
--- a/ctdb/doc/ctdbd.conf.5.xml
+++ b/ctdb/doc/ctdbd.conf.5.xml
@@ -114,9 +114,7 @@
runtime.
- Defaults to /var/ctdb, unless
- /var/lib/ctdb already exists in which
- case it is used.
+ Defaults to /usr/local/var/lib/ctdb.
@@ -172,8 +170,10 @@
CTDB_DBDIR=DIRECTORY
- Defaults to CTDB_VARDIR. Corresponds to
- .
+ Defaults to /usr/local/var/lib/ctdb.
+
+
+ Corresponds to .
@@ -182,7 +182,9 @@
CTDB_DBDIR_PERSISTENT=DIRECTORY
- Defaults to CTDB_VARDIR/persistent.
+ Defaults to /usr/local/var/lib/ctdb/persistent.
+
+
Corresponds to .
@@ -192,7 +194,9 @@
CTDB_DBDIR_STATE=DIRECTORY
- Defaults to CTDB_VARDIR/state.
+ Defaults to /usr/local/var/lib/ctdb/state.
+
+
Corresponds to .
diff --git a/ctdb/wscript b/ctdb/wscript
index 7f3b9e7e15d..c8dd44e4366 100755
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -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,10 +448,20 @@ 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''',
- True)
+ 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',
destname='onnode', chmod=0755)
@@ -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: