diff --git a/ctdb/config/ctdb.sudoers b/ctdb/config/ctdb.sudoers index 1c6619b654b..1c238180cc9 100644 --- a/ctdb/config/ctdb.sudoers +++ b/ctdb/config/ctdb.sudoers @@ -1,3 +1,3 @@ -Defaults!/etc/ctdb/statd-callout !requiretty +Defaults!/usr/local/etc/ctdb/statd-callout !requiretty -rpcuser ALL=(ALL) NOPASSWD: /etc/ctdb/statd-callout +rpcuser ALL=(ALL) NOPASSWD: /usr/local/etc/ctdb/statd-callout diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index c5fe00451df..66d88c9559c 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -15,14 +15,16 @@ action="$2" ############################################################ -[ -n "$CTDB_BASE" ] || export CTDB_BASE="/etc/ctdb" +if [ -z "$CTDB_BASE" ] ; then + export CTDB_BASE="/usr/local/etc/ctdb" +fi . "${CTDB_BASE}/functions" loadconfig "ctdb" [ -n "$CTDB_SOCKET" ] && export CTDB_SOCKET -ctdbd="${CTDBD:-/usr/sbin/ctdbd}" +ctdbd="${CTDBD:-/usr/local/sbin/ctdbd}" ############################################################ @@ -184,7 +186,7 @@ start() if [ -n "$CTDB_VALGRIND" -a "$CTDB_VALGRIND" != "no" ] ; then if [ "$CTDB_VALGRIND" = "yes" ] ; then - ctdbd="valgrind -q --log-file=/var/log/ctdb_valgrind ${ctdbd}" + ctdbd="valgrind -q --log-file=/usr/local/var/log/ctdb_valgrind ${ctdbd}" else ctdbd="${CTDB_VALGRIND} ${ctdbd}" fi diff --git a/ctdb/config/functions b/ctdb/config/functions index 994c638a5bb..49bed988f5e 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -101,7 +101,7 @@ script_log () if [ -n "$CTDB_LOGGING" ] ; then _file="${CTDB_LOGGING#file:}" else - _file="/var/log/log.ctdb" + _file="/usr/local/var/log/log.ctdb" fi { if [ -n "$*" ] ; then diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml index 17347297a94..613efff426f 100644 --- a/ctdb/doc/ctdb.1.xml +++ b/ctdb/doc/ctdb.1.xml @@ -1105,7 +1105,7 @@ DB Statistics: locking.tdb - On all nodes, edit /etc/ctdb/nodes + On all nodes, edit /usr/local/etc/ctdb/nodes and add the new nodes at the end of this file. @@ -1113,7 +1113,7 @@ DB Statistics: locking.tdb Verify that all the nodes have identical - /etc/ctdb/nodes files after adding + /usr/local/etc/ctdb/nodes files after adding the new nodes. @@ -1156,7 +1156,7 @@ DB Statistics: locking.tdb On all other nodes, edit the - /etc/ctdb/nodes file and + /usr/local/etc/ctdb/nodes file and comment out the nodes to be removed. Do not delete the lines for the deleted nodes, just comment them out by adding a '#' at @@ -1217,24 +1217,24 @@ DB Statistics: locking.tdb # ctdb getdbmap Number of databases:10 -dbid:0x435d3410 name:notify.tdb path:/var/ctdb/notify.tdb.0 -dbid:0x42fe72c5 name:locking.tdb path:/var/ctdb/locking.tdb.0 -dbid:0x1421fb78 name:brlock.tdb path:/var/ctdb/brlock.tdb.0 -dbid:0x17055d90 name:connections.tdb path:/var/ctdb/connections.tdb.0 -dbid:0xc0bdde6a name:sessionid.tdb path:/var/ctdb/sessionid.tdb.0 -dbid:0x122224da name:test.tdb path:/var/ctdb/test.tdb.0 -dbid:0x2672a57f name:idmap2.tdb path:/var/ctdb/persistent/idmap2.tdb.0 PERSISTENT -dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSISTENT -dbid:0xe98e08b6 name:group_mapping.tdb path:/var/ctdb/persistent/group_mapping.tdb.0 PERSISTENT -dbid:0x7bbbd26c name:passdb.tdb path:/var/ctdb/persistent/passdb.tdb.0 PERSISTENT +dbid:0x435d3410 name:notify.tdb path:/usr/local/var/lib/ctdb/notify.tdb.0 +dbid:0x42fe72c5 name:locking.tdb path:/usr/local/var/lib/ctdb/locking.tdb.0 +dbid:0x1421fb78 name:brlock.tdb path:/usr/local/var/lib/ctdb/brlock.tdb.0 +dbid:0x17055d90 name:connections.tdb path:/usr/local/var/lib/ctdb/connections.tdb.0 +dbid:0xc0bdde6a name:sessionid.tdb path:/usr/local/var/lib/ctdb/sessionid.tdb.0 +dbid:0x122224da name:test.tdb path:/usr/local/var/lib/ctdb/test.tdb.0 +dbid:0x2672a57f name:idmap2.tdb path:/usr/local/var/lib/ctdb/persistent/idmap2.tdb.0 PERSISTENT +dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT +dbid:0xe98e08b6 name:group_mapping.tdb path:/usr/local/var/lib/ctdb/persistent/group_mapping.tdb.0 PERSISTENT +dbid:0x7bbbd26c name:passdb.tdb path:/usr/local/var/lib/ctdb/persistent/passdb.tdb.0 PERSISTENT # ctdb getdbmap # example for unhealthy database Number of databases:1 -dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSISTENT UNHEALTHY +dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT UNHEALTHY # ctdb -X getdbmap |ID|Name|Path|Persistent|Unhealthy| -|0x7bbbd26c|passdb.tdb|/var/ctdb/persistent/passdb.tdb.0|1|0| +|0x7bbbd26c|passdb.tdb|/usr/local/var/lib/ctdb/persistent/passdb.tdb.0|1|0| @@ -1534,16 +1534,16 @@ RUNNING # ctdb getdbstatus test.tdb.0 dbid: 0x122224da name: test.tdb -path: /var/ctdb/test.tdb.0 +path: /usr/local/var/lib/ctdb/test.tdb.0 PERSISTENT: no HEALTH: OK # ctdb getdbstatus registry.tdb # with a corrupted TDB dbid: 0xf2a58948 name: registry.tdb -path: /var/ctdb/persistent/registry.tdb.0 +path: /usr/local/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT: yes -HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/var/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z' +HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/lib/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z' diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml index ad17df7de59..ffa51db7ce0 100644 --- a/ctdb/doc/ctdb.7.xml +++ b/ctdb/doc/ctdb.7.xml @@ -167,7 +167,7 @@ CTDB_NODES configuration variable (see ctdbd.conf 5, default - /etc/ctdb/nodes). This file contains the + /usr/local/etc/ctdb/nodes). This file contains the list of private addresses for all nodes in the cluster, one per line. This file must be the same on all nodes in the cluster. @@ -183,7 +183,7 @@ - Example /etc/ctdb/nodes for a four node + Example /usr/local/etc/ctdb/nodes for a four node cluster: @@ -219,7 +219,7 @@ configuration variable (see ctdbd.conf 5, recommended - /etc/ctdb/public_addresses). This file + /usr/local/etc/ctdb/public_addresses). This file contains a list of the public addresses that the node is capable of hosting, one per line. Each entry also contains the netmask and the interface to which the address should be @@ -227,7 +227,7 @@ - Example /etc/ctdb/public_addresses for a + Example /usr/local/etc/ctdb/public_addresses for a node that can host 4 public addresses, on 2 different interfaces: @@ -248,19 +248,19 @@ Example: 4 nodes partitioned into two subgroups: -Node 0:/etc/ctdb/public_addresses +Node 0:/usr/local/etc/ctdb/public_addresses 10.1.1.1/24 eth1 10.1.1.2/24 eth1 -Node 1:/etc/ctdb/public_addresses +Node 1:/usr/local/etc/ctdb/public_addresses 10.1.1.1/24 eth1 10.1.1.2/24 eth1 -Node 2:/etc/ctdb/public_addresses +Node 2:/usr/local/etc/ctdb/public_addresses 10.1.2.1/24 eth2 10.1.2.2/24 eth2 -Node 3:/etc/ctdb/public_addresses +Node 3:/usr/local/etc/ctdb/public_addresses 10.1.2.1/24 eth2 10.1.2.2/24 eth2 @@ -649,7 +649,7 @@ CTDB_LVS_PUBLIC_IP=10.1.1.237 NATGW is usually configured similar to the following example configuration: -CTDB_NATGW_NODES=/etc/ctdb/natgw_nodes +CTDB_NATGW_NODES=/usr/local/etc/ctdb/natgw_nodes CTDB_NATGW_PRIVATE_NETWORK=192.168.1.0/24 CTDB_NATGW_PUBLIC_IP=10.0.0.227/24 CTDB_NATGW_PUBLIC_IFACE=eth0 @@ -871,12 +871,12 @@ CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1 -/etc/ctdb/public_addresses: +/usr/local/etc/ctdb/public_addresses: 192.168.1.98 eth2,eth3 192.168.1.99 eth2,eth3 -/etc/ctdb/policy_routing: +/usr/local/etc/ctdb/policy_routing: 192.168.1.98 192.168.1.0/24 192.168.1.98 192.168.200.0/24 192.168.1.254 @@ -910,9 +910,9 @@ CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1 The specified script must be executable. - Use of the provided /etc/ctdb/notify.sh + Use of the provided /usr/local/etc/ctdb/notify.sh script is recommended. It executes files in - /etc/ctdb/notify.d/. + /usr/local/etc/ctdb/notify.d/. CTDB currently generates notifications after CTDB changes to diff --git a/ctdb/doc/ctdbd.1.xml b/ctdb/doc/ctdbd.1.xml index 8f6b7c9ac5f..8516e8f000a 100644 --- a/ctdb/doc/ctdbd.1.xml +++ b/ctdb/doc/ctdbd.1.xml @@ -117,7 +117,7 @@ Default is CTDB_BASE/events.d, so usually - /etc/ctdb/events.d, which is part of + /usr/local/etc/ctdb/events.d, which is part of the CTDB installation. @@ -150,9 +150,8 @@ STRING specifies where ctdbd will write its log. The - default is file:/var/log/log.ctdb or - similar - the prefix may differ depending on how CTDB was - built. + default is + file:/usr/local/var/log/log.ctdb. Valid values are: @@ -163,7 +162,7 @@ FILENAME where ctdbd will write its log. This is usually - /var/log/log.ctdb. + /usr/local/var/log/log.ctdb. @@ -269,7 +268,7 @@ Default is CTDB_BASE/nodes, so usually - /etc/ctdb/nodes. + /usr/local/etc/ctdb/nodes. @@ -318,7 +317,7 @@ This file is usually - /etc/ctdb/notify.sh. + /usr/local/etc/ctdb/notify.sh. Please see the NOTIFICATION SCRIPT @@ -359,7 +358,7 @@ This is usually the file - /etc/ctdb/public_addresses + /usr/local/etc/ctdb/public_addresses diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml index 082af0c1503..e4048310cce 100644 --- a/ctdb/doc/ctdbd.conf.5.xml +++ b/ctdb/doc/ctdbd.conf.5.xml @@ -23,7 +23,7 @@ This file contains CTDB configuration variables that are affect the operation of CTDB. The default location of this file is - /etc/ctdb/ctdbd.conf. + /usr/local/etc/ctdb/ctdbd.conf. @@ -44,7 +44,7 @@ /etc/default/ctdb (Debian). However, these files should be reserved for variables used by the initscript. A historical alternative is - /etc/ctdb/sysconfig/ctdb - this is + /usr/local/etc/ctdb/sysconfig/ctdb - this is deprecated. @@ -76,7 +76,7 @@ - Default is /var/run/ctdb/ctdbd.pid. + Default is /usr/local/var/run/ctdb/ctdbd.pid. Corresponds to . @@ -203,7 +203,7 @@ Default is CTDB_BASE/events.d, so usually - /etc/ctdb/events.d. Corresponds to + /usr/local/etc/ctdb/events.d. Corresponds to . @@ -214,9 +214,9 @@ STRING specifies where ctdbd will write its log. The - default is file:/var/log/log.ctdb or - similar - the prefix may differ depending on how CTDB was - built. Corresponds to . + default is + file:/usr/local/var/log/log.ctdb. + Corresponds to . Valid values are: @@ -227,7 +227,7 @@ FILENAME where ctdbd will write its log. This is usually - /var/log/log.ctdb. + /usr/local/var/log/log.ctdb. @@ -306,7 +306,7 @@ Default is CTDB_BASE/nodes, so usually - /etc/ctdb/nodes. Corresponds to + /usr/local/etc/ctdb/nodes. Corresponds to . @@ -317,7 +317,7 @@ No default, usually - /etc/ctdb/notify.sh. Corresponds to + /usr/local/etc/ctdb/notify.sh. Corresponds to . @@ -361,7 +361,7 @@ No default, usually - /etc/ctdb/public_addresses. + /usr/local/etc/ctdb/public_addresses. Corresponds to . @@ -555,7 +555,7 @@ No default, usually - /etc/ctdb/natgw_nodes when enabled. + /usr/local/etc/ctdb/natgw_nodes when enabled. @@ -661,7 +661,7 @@ Example -CTDB_NATGW_NODES=/etc/ctdb/natgw_nodes +CTDB_NATGW_NODES=/usr/local/etc/ctdb/natgw_nodes CTDB_NATGW_PRIVATE_NETWORK=192.168.1.0/24 CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1 CTDB_NATGW_PUBLIC_IP=10.0.0.227/24 @@ -674,7 +674,7 @@ CTDB_NATGW_PUBLIC_IFACE=eth0 always reachable would look like this: -CTDB_NATGW_NODES=/etc/ctdb/natgw_nodes +CTDB_NATGW_NODES=/usr/local/etc/ctdb/natgw_nodes CTDB_NATGW_PRIVATE_NETWORK=192.168.1.0/24 CTDB_NATGW_PUBLIC_IP=10.0.0.227/24 CTDB_NATGW_PUBLIC_IFACE=eth0 @@ -736,7 +736,7 @@ CTDB_NATGW_STATIC_ROUTES=10.0.0.0/24 No default, usually - /etc/ctdb/policy_routing when enabled. + /usr/local/etc/ctdb/policy_routing when enabled. @@ -802,7 +802,7 @@ CTDB_NATGW_STATIC_ROUTES=10.0.0.0/24 Example -CTDB_PER_IP_ROUTING_CONF=/etc/ctdb/policy_routing +CTDB_PER_IP_ROUTING_CONF=/usr/local/etc/ctdb/policy_routing CTDB_PER_IP_ROUTING_RULE_PREF=100 CTDB_PER_IP_ROUTING_TABLE_ID_LOW=1000 CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 @@ -1628,7 +1628,7 @@ CTDB_SET_MonitorInterval=20 1 to be run under valgrind 1 with logs going to - /var/log/ctdb_valgrind. If neither + /usr/local/var/log/ctdb_valgrind. If neither "yes" nor "no" then the value is assumed to be a COMMAND (e.g. a valgrind variation, a gdb @@ -1665,10 +1665,10 @@ CTDB_SET_MonitorInterval=20 FILES - /etc/ctdb/ctdbd.conf + /usr/local/etc/ctdb/ctdbd.conf /etc/sysconfig/ctdb /etc/default/ctdb - /etc/ctdb/sysconfig/ctdb + /usr/local/etc/ctdb/sysconfig/ctdb diff --git a/ctdb/doc/onnode.1.xml b/ctdb/doc/onnode.1.xml index ec878031633..02898d2d65d 100644 --- a/ctdb/doc/onnode.1.xml +++ b/ctdb/doc/onnode.1.xml @@ -61,8 +61,8 @@ Specify an alternative nodes FILENAME to use instead of the default. This option overrides the CTDB_NODES_FILE - environment variable. See the discussion of - /etc/ctdb/nodes in the FILES section + and CTDB_NODES variables. See the discussion of + /usr/local/etc/ctdb/nodes in the FILES section for more details. @@ -235,7 +235,7 @@ node, preceded by the node's hostname - onnode all "hostname; tail -5 /var/log/log.ctdb" + onnode all "hostname; tail -5 /usr/local/var/log/log.ctdb" @@ -263,7 +263,7 @@ Directory containing CTDB configuration files. The - default is /etc/ctdb. + default is /usr/local/etc/ctdb. @@ -285,26 +285,35 @@ FILES - /etc/ctdb/nodes + /usr/local/etc/ctdb/nodes Default file containing a list of each node's IP address or hostname. - Actually, the default is + As above, a file specified via the or + CTDB_NODES_FILE is given precedence. If a + relative path is specified and no corresponding file + exists relative to the current directory then the file is + also searched for in the $CTDB_BASE + directory. + + + If CTDB_NODES_FILE is not set and + CTDB_NODES is set in configuration then the + file pointed to by CTDB_NODES is used. + + + Otherwise the default is $CTDB_BASE/nodes, where CTDB_BASE defaults to - /etc/ctdb. If a relative path is - given (via the -f option or CTDB_BASE) and - no corresponding file exists relative to the current - directory then the file is also searched for in the - $CTDB_BASE directory. - - + /usr/local/etc/ctdb. + + - /etc/ctdb/onnode.conf + /usr/local/etc/ctdb/onnode.conf If this file exists it is sourced by onnode. The main diff --git a/ctdb/tests/onnode/functions b/ctdb/tests/onnode/functions new file mode 120000 index 00000000000..ff10411b5eb --- /dev/null +++ b/ctdb/tests/onnode/functions @@ -0,0 +1 @@ +../../config/functions \ No newline at end of file diff --git a/ctdb/tests/simple/functions b/ctdb/tests/simple/functions new file mode 120000 index 00000000000..ff10411b5eb --- /dev/null +++ b/ctdb/tests/simple/functions @@ -0,0 +1 @@ +../../config/functions \ No newline at end of file diff --git a/ctdb/tests/simple/scripts/local.bash b/ctdb/tests/simple/scripts/local.bash index 81fc0f02bff..1ccbb235f1d 100644 --- a/ctdb/tests/simple/scripts/local.bash +++ b/ctdb/tests/simple/scripts/local.bash @@ -1,3 +1,8 @@ +# onnode needs CTDB_BASE to be set when run in-tree +if [ -z "$CTDB_BASE" ] ; then + export CTDB_BASE="$TEST_SUBDIR" +fi + if [ -n "$TEST_LOCAL_DAEMONS" ] ; then . "${TEST_SUBDIR}/scripts/local_daemons.bash" fi diff --git a/ctdb/tools/ctdb_diagnostics b/ctdb/tools/ctdb_diagnostics index 96ab5d0ddfc..a8c8c4281d6 100755 --- a/ctdb/tools/ctdb_diagnostics +++ b/ctdb/tools/ctdb_diagnostics @@ -72,14 +72,14 @@ PATH="$PATH:/sbin:/usr/sbin:/usr/lpp/mmfs/bin" # list of config files that must exist and that we check are the same # on the nodes if [ -d /etc/sysconfig ] ; then - CONFIG_FILES_MUST="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/sysconfig/ctdb /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/sysconfig/nfs /etc/exports /etc/vsftpd/vsftpd.conf" + CONFIG_FILES_MUST="/etc/krb5.conf /etc/hosts /usr/local/etc/ctdb/nodes /etc/sysconfig/ctdb /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/sysconfig/nfs /etc/exports /etc/vsftpd/vsftpd.conf" else - CONFIG_FILES_MUST="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/default/ctdb /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/default/nfs /etc/exports /etc/vsftpd/vsftpd.conf" + CONFIG_FILES_MUST="/etc/krb5.conf /etc/hosts /usr/local/etc/ctdb/nodes /etc/default/ctdb /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/default/nfs /etc/exports /etc/vsftpd/vsftpd.conf" fi # list of config files that may exist and should be checked that they # are the same on the nodes -CONFIG_FILES_MAY="/etc/ctdb/public_addresses /etc/ctdb/static-routes" +CONFIG_FILES_MAY="/usr/local/etc/ctdb/public_addresses /usr/local/etc/ctdb/static-routes" 2>&1 @@ -181,7 +181,7 @@ cat < 1 {print \$3}' | sort | xargs -n 1 ctdb dbstatistics" echo "Showing log.ctdb" -show_all "test -f /var/log/log.ctdb && tail -100 /var/log/log.ctdb" +show_all "test -f /usr/local/var/log/log.ctdb && tail -100 /usr/local/var/log/log.ctdb" echo "Showing log.ctdb" -show_all "test -f /var/log/log.ctdb && tail -100 /var/log/log.ctdb" +show_all "test -f /usr/local/var/log/log.ctdb && tail -100 /usr/local/var/log/log.ctdb" show_all "tail -200 /var/log/messages" -show_all "ls -lRs /var/ctdb" -show_all "ls -lRs /etc/ctdb" +show_all "ls -lRs /usr/local/var/lib/ctdb" +show_all "ls -lRs /usr/local/etc/ctdb" cat </dev/null || true" but want to see errors from typos in file. - [ -r "${ctdb_base}/onnode.conf" ] && . "${ctdb_base}/onnode.conf" + [ -r "${CTDB_BASE}/onnode.conf" ] && . "${CTDB_BASE}/onnode.conf" [ -n "$SSH" ] || SSH=ssh if [ "$SSH" = "ssh" ] ; then if $parallel || ! $stdin ; then diff --git a/ctdb/wscript b/ctdb/wscript index c8dd44e4366..a883872e05d 100755 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -449,7 +449,12 @@ def build(bld): destname='README') sed_expr1 = 's|/usr/local/var/lib/ctdb|%s|g' % (bld.env.CTDB_VARDIR) - sed_cmdline = '-e "%s"' % (sed_expr1) + sed_expr2 = 's|/usr/local/etc/ctdb|%s|g' % (bld.env.CTDB_ETCDIR) + sed_expr3 = 's|/usr/local/var/log|%s|g' % (bld.env.CTDB_LOGDIR) + sed_expr4 = 's|/usr/local/var/run/ctdb|%s|g' % (bld.env.CTDB_RUNDIR) + sed_expr5 = 's|/usr/local/sbin|%s|g' % (bld.env.SBINDIR) + sed_cmdline = '-e "%s" -e "%s" -e "%s" -e "%s" -e "%s"' % \ + (sed_expr1, sed_expr2, sed_expr3, sed_expr4, sed_expr5) for f in manpages: x = '%s.xml' % (f) @@ -463,11 +468,25 @@ def build(bld): ctdb.7 ctdb-statistics.7 ctdb-tunables.7''', True) - bld.INSTALL_FILES('${BINDIR}', 'tools/onnode', + bld.SAMBA_GENERATOR('ctdb-onnode', + source='tools/onnode', + target='onnode', + rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline)) + bld.INSTALL_FILES('${BINDIR}', 'onnode', destname='onnode', chmod=0755) - bld.INSTALL_FILES('${BINDIR}', 'tools/ctdb_diagnostics', + + bld.SAMBA_GENERATOR('ctdb-diagnostics', + source='tools/ctdb_diagnostics', + target='ctdb_diagnostics', + rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline)) + bld.INSTALL_FILES('${BINDIR}', 'ctdb_diagnostics', destname='ctdb_diagnostics', chmod=0755) - bld.INSTALL_FILES('${SBINDIR}', 'config/ctdbd_wrapper', + + bld.SAMBA_GENERATOR('ctdbd-wrapper', + source='config/ctdbd_wrapper', + target='ctdbd_wrapper', + rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline)) + bld.INSTALL_FILES('${SBINDIR}', 'ctdbd_wrapper', destname='ctdbd_wrapper', chmod=0755) def SUBDIR_MODE_callback(arg, dirname, fnames): @@ -521,7 +540,11 @@ def build(bld): bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % t, destname=t, chmod=0755) - bld.INSTALL_FILES('${SYSCONFDIR}/sudoers.d', 'config/ctdb.sudoers', + bld.SAMBA_GENERATOR('ctdb-sudoers', + source='config/ctdb.sudoers', + target='ctdb.sudoers', + rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline)) + bld.INSTALL_FILES('${SYSCONFDIR}/sudoers.d', 'ctdb.sudoers', destname='ctdb') bld.INSTALL_FILES('${CTDB_ETCDIR}/notify.d', 'config/notify.d.README', @@ -665,6 +688,17 @@ def build(bld): bld.symlink_as(os.path.join(test_link_dir, t), os.path.join(bld.env.CTDB_ETCDIR, t)) + # Tests that use onnode need to overwrite link to in-tree + # functions file when installed + bld.symlink_as(os.path.join(bld.env.CTDB_TEST_DATADIR, 'onnode/functions'), + os.path.join(bld.env.CTDB_ETCDIR, 'functions')) + bld.symlink_as(os.path.join(bld.env.CTDB_TEST_DATADIR, 'simple/functions'), + os.path.join(bld.env.CTDB_ETCDIR, 'functions')) + + # Need a link to nodes file because $CTDB_BASE is overridden + bld.symlink_as(os.path.join(bld.env.CTDB_TEST_DATADIR, 'simple/nodes'), + os.path.join(bld.env.CTDB_ETCDIR, 'nodes')) + def testonly(ctx): cmd = 'tests/run_tests.sh -V tests/var'