make ipropd_slave tell its status in a status file
The ipropd_slave will log its status to /var/heimdal/ipropd-slave-status if its connecting, up to date, or disconnected. The master will now also confirm to slaves that are are in fact up to date if they just restart, before there was no confirmation, the slave just didn't get any deltas.
This commit is contained in:
@@ -90,6 +90,10 @@ ipdm=
|
||||
kdcpid=
|
||||
|
||||
> iprop-stats
|
||||
rm -f iprop-slave-status
|
||||
|
||||
ipropd_slave="${ipropd_slave} --status-file=iprop-slave-status"
|
||||
|
||||
trap "echo 'killing ipropd s + m + kdc'; kill -9 \${ipdm} \${ipds} \${kdcpid} >/dev/null 2>/dev/null; tail messages.log ; tail iprop-stats; exit 1;" EXIT
|
||||
|
||||
echo Starting kdc
|
||||
@@ -111,9 +115,11 @@ KRB5_CONFIG="${objdir}/krb5-slave.conf" \
|
||||
${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost &
|
||||
ipds=$!
|
||||
sh ${wait_kdc} ipropd-slave || exit 1
|
||||
sleep 1
|
||||
|
||||
echo "checking slave is up"
|
||||
${EGREP} 'iprop/slave.test.h5l.se@TEST.H5L.SE.*Up' iprop-stats >/dev/null || exit 1
|
||||
${EGREP} 'up-to-date with version' iprop-slave-status >/dev/null || { echo "slave to up to date" ; cat iprop-slave-status ; exit 1; }
|
||||
|
||||
# ----------------- checking: pushing lives changes
|
||||
|
||||
@@ -140,7 +146,7 @@ ${kadmin} -l get host/bar@${R} > /dev/null 2>/dev/null && exit 1
|
||||
echo "kill slave"
|
||||
> iprop-stats
|
||||
sh ${leaks_kill} ipropd-slave $ipds || exit 1
|
||||
sleep 2
|
||||
rm -f iprop-slave-status
|
||||
|
||||
${EGREP} 'iprop/slave.test.h5l.se@TEST.H5L.SE.*Down' iprop-stats >/dev/null || exit 1
|
||||
|
||||
@@ -163,9 +169,11 @@ KRB5_CONFIG="${objdir}/krb5-slave.conf" \
|
||||
${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost &
|
||||
ipds=$!
|
||||
sh ${wait_kdc} ipropd-slave || exit 1
|
||||
sleep 1
|
||||
|
||||
echo "checking slave is up again"
|
||||
${EGREP} 'iprop/slave.test.h5l.se@TEST.H5L.SE.*Up' iprop-stats >/dev/null || exit 1
|
||||
${EGREP} 'up-to-date with version' iprop-slave-status >/dev/null || { echo "slave not up to date" ; cat iprop-slave-status ; exit 1; }
|
||||
echo "checking for replay problems"
|
||||
${EGREP} 'Entry already exists in database' messages.log && exit 1
|
||||
|
||||
@@ -175,15 +183,18 @@ sleep 2
|
||||
|
||||
rm current.slave.log current-db.slave* || exit 1
|
||||
> iprop-stats
|
||||
rm -f iprop-slave-status
|
||||
> messages.log
|
||||
env ${HEIM_MALLOC_DEBUG} \
|
||||
KRB5_CONFIG="${objdir}/krb5-slave.conf" \
|
||||
${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost &
|
||||
ipds=$!
|
||||
sh ${wait_kdc} ipropd-slave || exit 1
|
||||
sleep 1
|
||||
|
||||
echo "checking slave is up again"
|
||||
${EGREP} 'iprop/slave.test.h5l.se@TEST.H5L.SE.*Up' iprop-stats >/dev/null || exit 1
|
||||
${EGREP} 'up-to-date with version' iprop-slave-status >/dev/null || { echo "slave not up to date" ; cat iprop-slave-status ; exit 1; }
|
||||
echo "checking for replay problems"
|
||||
${EGREP} 'Entry already exists in database' messages.log && exit 1
|
||||
|
||||
@@ -200,6 +211,8 @@ echo "Killing master and slave"
|
||||
sh ${leaks_kill} ipropd-master $ipdm || exit 1
|
||||
sh ${leaks_kill} ipropd-slave $ipds || exit 1
|
||||
|
||||
rm -f iprop-slave-status
|
||||
|
||||
#sleep 2
|
||||
#${EGREP} "^master down at " iprop-stats > /dev/null || exit 1
|
||||
|
||||
@@ -229,9 +242,11 @@ KRB5_CONFIG="${objdir}/krb5-slave.conf" \
|
||||
${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost &
|
||||
ipds=$!
|
||||
sh ${wait_kdc} ipropd-slave || exit 1
|
||||
sleep 1
|
||||
|
||||
echo "checking slave is up again"
|
||||
${EGREP} 'iprop/slave.test.h5l.se@TEST.H5L.SE.*Up' iprop-stats >/dev/null || exit 1
|
||||
${EGREP} 'up-to-date with version' iprop-slave-status >/dev/null || { echo "slave to up to date" ; cat iprop-slave-status ; exit 1; }
|
||||
echo "checking for replay problems"
|
||||
${EGREP} 'Entry already exists in database' messages.log && exit 1
|
||||
|
||||
@@ -244,6 +259,8 @@ sh ${leaks_kill} ipropd-master $ipdm || exit 1
|
||||
|
||||
sleep 4
|
||||
|
||||
${EGREP} 'disconnected' iprop-slave-status >/dev/null && { echo "slave still think its connected" ; cat iprop-slave-status ; exit 1; }
|
||||
|
||||
if ! tail -30 messages.log | grep 'disconnected for server' > /dev/null; then
|
||||
echo "client didnt disconnect"
|
||||
exit 1
|
||||
@@ -279,6 +296,8 @@ sh ${leaks_kill} kdc $kdcpid || exit 1
|
||||
sh ${leaks_kill} ipropd-master $ipdm || exit 1
|
||||
sh ${leaks_kill} ipropd-slave $ipds || exit 1
|
||||
|
||||
rm -f iprop-slave-status
|
||||
|
||||
echo "compare versions on master and slave logs"
|
||||
KRB5_CONFIG=${objdir}/krb5-slave.conf \
|
||||
${iprop_log} last-version > slave-last.tmp
|
||||
|
Reference in New Issue
Block a user