mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb: Install helpers under libexecdir
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
2deba05c58
commit
0a5cb637d4
@ -168,7 +168,7 @@ natgw_set_slave ()
|
|||||||
|
|
||||||
natgw_ensure_master ()
|
natgw_ensure_master ()
|
||||||
{
|
{
|
||||||
set -- $(ctdb_natgw master)
|
set -- $("${CTDB_HELPER_BINDIR}/ctdb_natgw" master)
|
||||||
natgwmaster="${1:--1}" # Default is -1 if natgwlist fails
|
natgwmaster="${1:--1}" # Default is -1 if natgwlist fails
|
||||||
natgwip="$2"
|
natgwip="$2"
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@ if [ -z "$CTDB_SYS_ETCDIR" ] ; then
|
|||||||
CTDB_SYS_ETCDIR="/etc"
|
CTDB_SYS_ETCDIR="/etc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CTDB_HELPER_BINDIR" ] ; then
|
||||||
|
CTDB_HELPER_BINDIR="/usr/local/libexec/ctdb"
|
||||||
|
fi
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# pull in a system config file, if any
|
# pull in a system config file, if any
|
||||||
|
|
||||||
|
@ -168,6 +168,7 @@ case "$1" in
|
|||||||
statd_state=$(ctdb catdb ctdb.tdb | sed -n "$sed_expr" | sort)
|
statd_state=$(ctdb catdb ctdb.tdb | sed -n "$sed_expr" | sort)
|
||||||
[ -n "$statd_state" ] || exit 0
|
[ -n "$statd_state" ] || exit 0
|
||||||
|
|
||||||
|
smnotify="${CTDB_HELPER_BINDIR}/smnotify"
|
||||||
prev=""
|
prev=""
|
||||||
echo "$statd_state" | {
|
echo "$statd_state" | {
|
||||||
# This all needs to be in the same command group at the
|
# This all needs to be in the same command group at the
|
||||||
@ -186,12 +187,12 @@ case "$1" in
|
|||||||
# Reset stateval for each serverip
|
# Reset stateval for each serverip
|
||||||
[ "$sip" = "$prev" ] || stateval="$state_even"
|
[ "$sip" = "$prev" ] || stateval="$state_even"
|
||||||
# Send notifies for server shutdown
|
# Send notifies for server shutdown
|
||||||
smnotify --client=$cip --ip=$sip --server=$sip --stateval=$stateval
|
"$smnotify" --client=$cip --ip=$sip --server=$sip --stateval=$stateval
|
||||||
smnotify --client=$cip --ip=$sip --server=$NFS_HOSTNAME --stateval=$stateval
|
"$smnotify" --client=$cip --ip=$sip --server=$NFS_HOSTNAME --stateval=$stateval
|
||||||
# Send notifies for server startup
|
# Send notifies for server startup
|
||||||
stateval=$(($stateval + 1))
|
stateval=$(($stateval + 1))
|
||||||
smnotify --client=$cip --ip=$sip --server=$sip --stateval=$stateval
|
"$smnotify" --client=$cip --ip=$sip --server=$sip --stateval=$stateval
|
||||||
smnotify --client=$cip --ip=$sip --server=$NFS_HOSTNAME --stateval=$stateval
|
"$smnotify" --client=$cip --ip=$sip --server=$NFS_HOSTNAME --stateval=$stateval
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$items" | ctdb ptrans "ctdb.tdb"
|
echo "$items" | ctdb ptrans "ctdb.tdb"
|
||||||
|
@ -195,15 +195,16 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_sbindir}/ctdbd
|
%{_sbindir}/ctdbd
|
||||||
%{_sbindir}/ctdbd_wrapper
|
%{_sbindir}/ctdbd_wrapper
|
||||||
%{_bindir}/ctdb
|
%{_bindir}/ctdb
|
||||||
%{_bindir}/ctdb_lock_helper
|
|
||||||
%{_bindir}/ctdb_event_helper
|
|
||||||
%{_bindir}/ctdb_recovery_helper
|
|
||||||
%{_bindir}/smnotify
|
|
||||||
%{_bindir}/ping_pong
|
%{_bindir}/ping_pong
|
||||||
%{_bindir}/ltdbtool
|
%{_bindir}/ltdbtool
|
||||||
%{_bindir}/ctdb_diagnostics
|
%{_bindir}/ctdb_diagnostics
|
||||||
%{_bindir}/onnode
|
%{_bindir}/onnode
|
||||||
%{_bindir}/ctdb_natgw
|
%dir %{_libexecdir}/ctdb
|
||||||
|
%{_libexecdir}/ctdb/ctdb_lock_helper
|
||||||
|
%{_libexecdir}/ctdb/ctdb_event_helper
|
||||||
|
%{_libexecdir}/ctdb/ctdb_recovery_helper
|
||||||
|
%{_libexecdir}/ctdb/ctdb_natgw
|
||||||
|
%{_libexecdir}/ctdb/smnotify
|
||||||
%dir %{_libdir}
|
%dir %{_libdir}
|
||||||
%{_libdir}/ctdb/lib*
|
%{_libdir}/ctdb/lib*
|
||||||
%{_libdir}/libtevent-unix-util.so.0*
|
%{_libdir}/libtevent-unix-util.so.0*
|
||||||
|
@ -13,6 +13,7 @@ if [ -d "${TEST_SUBDIR}/stubs" ] ; then
|
|||||||
/*) : ;;
|
/*) : ;;
|
||||||
*) EVENTSCRIPTS_PATH="${PWD}/${EVENTSCRIPTS_PATH}" ;;
|
*) EVENTSCRIPTS_PATH="${PWD}/${EVENTSCRIPTS_PATH}" ;;
|
||||||
esac
|
esac
|
||||||
|
export CTDB_HELPER_BINDIR="$EVENTSCRIPTS_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export EVENTSCRIPTS_PATH
|
export EVENTSCRIPTS_PATH
|
||||||
|
19
ctdb/wscript
19
ctdb/wscript
@ -181,6 +181,7 @@ def configure(conf):
|
|||||||
conf.env.CTDB_ETCDIR = os.path.join(conf.env.SYSCONFDIR, 'ctdb')
|
conf.env.CTDB_ETCDIR = os.path.join(conf.env.SYSCONFDIR, 'ctdb')
|
||||||
conf.env.CTDB_VARDIR = os.path.join(conf.env.LOCALSTATEDIR, 'lib/ctdb')
|
conf.env.CTDB_VARDIR = os.path.join(conf.env.LOCALSTATEDIR, 'lib/ctdb')
|
||||||
conf.env.CTDB_RUNDIR = os.path.join(conf.env.LOCALSTATEDIR, 'run/ctdb')
|
conf.env.CTDB_RUNDIR = os.path.join(conf.env.LOCALSTATEDIR, 'run/ctdb')
|
||||||
|
conf.env.CTDB_HELPER_BINDIR = os.path.join(conf.env.LIBEXECDIR, 'ctdb')
|
||||||
|
|
||||||
if Options.options.ctdb_logdir:
|
if Options.options.ctdb_logdir:
|
||||||
conf.env.CTDB_LOGDIR = Options.options.ctdb_logdir
|
conf.env.CTDB_LOGDIR = Options.options.ctdb_logdir
|
||||||
@ -199,7 +200,7 @@ def configure(conf):
|
|||||||
-DCTDB_ETCDIR=\"%s\"
|
-DCTDB_ETCDIR=\"%s\"
|
||||||
-DCTDB_VARDIR=\"%s\"
|
-DCTDB_VARDIR=\"%s\"
|
||||||
-DCTDB_RUNDIR=\"%s\"''' % (
|
-DCTDB_RUNDIR=\"%s\"''' % (
|
||||||
conf.env.CTDB_BINDIR,
|
conf.env.CTDB_HELPER_BINDIR,
|
||||||
conf.env.CTDB_LOGDIR,
|
conf.env.CTDB_LOGDIR,
|
||||||
conf.env.CTDB_ETCDIR,
|
conf.env.CTDB_ETCDIR,
|
||||||
conf.env.CTDB_VARDIR,
|
conf.env.CTDB_VARDIR,
|
||||||
@ -432,19 +433,19 @@ def build(bld):
|
|||||||
source='server/ctdb_lock_helper.c',
|
source='server/ctdb_lock_helper.c',
|
||||||
deps='samba-util ctdb-system talloc tdb',
|
deps='samba-util ctdb-system talloc tdb',
|
||||||
includes='include',
|
includes='include',
|
||||||
install_path='${BINDIR}')
|
install_path='${CTDB_HELPER_BINDIR}')
|
||||||
|
|
||||||
bld.SAMBA_BINARY('ctdb_event_helper',
|
bld.SAMBA_BINARY('ctdb_event_helper',
|
||||||
source='server/ctdb_event_helper.c',
|
source='server/ctdb_event_helper.c',
|
||||||
includes='include',
|
includes='include',
|
||||||
deps='samba-util ctdb-system replace tdb',
|
deps='samba-util ctdb-system replace tdb',
|
||||||
install_path='${BINDIR}')
|
install_path='${CTDB_HELPER_BINDIR}')
|
||||||
|
|
||||||
bld.SAMBA_BINARY('ctdb_recovery_helper',
|
bld.SAMBA_BINARY('ctdb_recovery_helper',
|
||||||
source='server/ctdb_recovery_helper.c',
|
source='server/ctdb_recovery_helper.c',
|
||||||
deps='''ctdb-client2 ctdb-protocol ctdb-util
|
deps='''ctdb-client2 ctdb-protocol ctdb-util
|
||||||
samba-util replace tdb''',
|
samba-util replace tdb''',
|
||||||
install_path='${BINDIR}')
|
install_path='${CTDB_HELPER_BINDIR}')
|
||||||
|
|
||||||
bld.SAMBA_GENERATOR('ctdb-smnotify-h',
|
bld.SAMBA_GENERATOR('ctdb-smnotify-h',
|
||||||
source='utils/smnotify/smnotify.x',
|
source='utils/smnotify/smnotify.x',
|
||||||
@ -468,7 +469,7 @@ def build(bld):
|
|||||||
'smnotify.c gen_smnotify.c gen_xdr.c'),
|
'smnotify.c gen_smnotify.c gen_xdr.c'),
|
||||||
deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt',
|
deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt',
|
||||||
includes='utils utils/smnotify',
|
includes='utils utils/smnotify',
|
||||||
install_path='${BINDIR}')
|
install_path='${CTDB_HELPER_BINDIR}')
|
||||||
|
|
||||||
bld.SAMBA_BINARY('ping_pong',
|
bld.SAMBA_BINARY('ping_pong',
|
||||||
source='utils/ping_pong/ping_pong.c',
|
source='utils/ping_pong/ping_pong.c',
|
||||||
@ -500,8 +501,10 @@ def build(bld):
|
|||||||
sed_expr3 = 's|/usr/local/var/log|%s|g' % (bld.env.CTDB_LOGDIR)
|
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_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_expr5 = 's|/usr/local/sbin|%s|g' % (bld.env.SBINDIR)
|
||||||
sed_cmdline = '-e "%s" -e "%s" -e "%s" -e "%s" -e "%s"' % \
|
sed_expr6 = 's|/usr/local/libexec/ctdb|%s|g' % (bld.env.CTDB_HELPER_BINDIR)
|
||||||
(sed_expr1, sed_expr2, sed_expr3, sed_expr4, sed_expr5)
|
sed_cmdline = '-e "%s" -e "%s" -e "%s" -e "%s" -e "%s" -e "%s"' % \
|
||||||
|
(sed_expr1, sed_expr2, sed_expr3, sed_expr4, sed_expr5,
|
||||||
|
sed_expr6)
|
||||||
|
|
||||||
for f in manpages:
|
for f in manpages:
|
||||||
x = '%s.xml' % (f)
|
x = '%s.xml' % (f)
|
||||||
@ -540,7 +543,7 @@ def build(bld):
|
|||||||
source='tools/ctdb_natgw',
|
source='tools/ctdb_natgw',
|
||||||
target='ctdb_natgw',
|
target='ctdb_natgw',
|
||||||
rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
|
rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
|
||||||
bld.INSTALL_FILES('${BINDIR}', 'ctdb_natgw',
|
bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_natgw',
|
||||||
destname='ctdb_natgw', chmod=0755)
|
destname='ctdb_natgw', chmod=0755)
|
||||||
|
|
||||||
bld.SAMBA_GENERATOR('ctdbd-wrapper',
|
bld.SAMBA_GENERATOR('ctdbd-wrapper',
|
||||||
|
Loading…
Reference in New Issue
Block a user