stale lockfile check
This commit is contained in:
parent
4cb2c5caee
commit
2adcac027b
@ -31,7 +31,14 @@ else
|
|||||||
echo "Info: Healthchecks disabled"
|
echo "Info: Healthchecks disabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# lockfile check
|
||||||
if [[ -f "${LOCKFILE}" ]] ; then
|
if [[ -f "${LOCKFILE}" ]] ; then
|
||||||
|
# check if stale lockfile
|
||||||
|
if [[ $(pgrep -c btrbk || true) -eq 0 ]] ; then
|
||||||
|
echo "Removing stale lock file: ${LOCKFILE}"
|
||||||
|
rm "${LOCKFILE}"
|
||||||
|
else
|
||||||
|
# another instance is really running, we exit
|
||||||
echo "Another instance is still running" | tee -a "${LOGFILE}"
|
echo "Another instance is still running" | tee -a "${LOGFILE}"
|
||||||
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
||||||
curl "${CURLOPTS[@]}" --data-binary "@${LOGFILE}" "${HEALTHCHECK_URL}/log"
|
curl "${CURLOPTS[@]}" --data-binary "@${LOGFILE}" "${HEALTHCHECK_URL}/log"
|
||||||
@ -39,6 +46,7 @@ if [[ -f "${LOCKFILE}" ]] ; then
|
|||||||
rm -f -- "${LOGFILE}"
|
rm -f -- "${LOGFILE}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
HOST=$(grep -E '^[\ \t]*target[\ \t]+send-receive' /etc/btrbk/btrbk.conf)
|
HOST=$(grep -E '^[\ \t]*target[\ \t]+send-receive' /etc/btrbk/btrbk.conf)
|
||||||
# TODO: support for dashes in hostname and IPv6 ("[2001:db8::7]")
|
# TODO: support for dashes in hostname and IPv6 ("[2001:db8::7]")
|
||||||
|
Loading…
Reference in New Issue
Block a user