Merge branch 'master' into debian
This commit is contained in:
commit
11a8b7e32d
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -18,6 +18,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
## [2.3.1] - 2020-04-22
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* State the age of the current "rm" process when killing it
|
||||||
|
* Give the new PID after killing the previous "rm" process
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* typos
|
||||||
|
* forgotten quotes
|
||||||
|
|
||||||
## [2.3.0] - 2020-04-20
|
## [2.3.0] - 2020-04-20
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -14,12 +14,14 @@ kill_or_clean_lockfile() {
|
||||||
# Get Process ID from the lock file
|
# Get Process ID from the lock file
|
||||||
pid=$(cat "${lock_file}")
|
pid=$(cat "${lock_file}")
|
||||||
if [ -n "${pid}" ]; then
|
if [ -n "${pid}" ]; then
|
||||||
if kill -0 ${pid} 2> /dev/null; then
|
if kill -0 "${pid}" 2> /dev/null; then
|
||||||
# Kill the children
|
# Kill the children
|
||||||
pkill -9 --parent "${pid}"
|
pkill -9 --parent "${pid}"
|
||||||
# Kill the parent
|
# Kill the parent
|
||||||
kill -9 "${pid}"
|
kill -9 "${pid}"
|
||||||
warning "Process ${pid} has been killed. Only one ${0} can run in parallel, the latest wins."
|
# Only one bkctld-rm can run in parallel, the latest wins
|
||||||
|
lockfile_date=$(date --date "@$(stat -c %Y ${lock_file})" +"%Y-%m-%d %H:%M:%S")
|
||||||
|
warning "Process \`${pid}' (started at ${lockfile_date}) has been killed by \`$$'"
|
||||||
else
|
else
|
||||||
warning "Process not found at PID \`${pid}'. Ignoring lock file \`${lock_file}'."
|
warning "Process not found at PID \`${pid}'. Ignoring lock file \`${lock_file}'."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -37,7 +37,7 @@ for try in $(seq 1 10); do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "${pid}" ]; then
|
if [ -n "${pid}" ]; then
|
||||||
notice "Start jail \`${jail_name}' : PID \`${pid}'"
|
notice "Start jail \`${jail_name}' : OK [${pid}]"
|
||||||
else
|
else
|
||||||
error "Failed to fetch SSH PID for jail \`${jail_name}' within 3 seconds"
|
error "Failed to fetch SSH PID for jail \`${jail_name}' within 3 seconds"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -24,7 +24,7 @@ WARNING="${WARNING:-24}"
|
||||||
DUC=$(command -v duc-nox || command -v duc)
|
DUC=$(command -v duc-nox || command -v duc)
|
||||||
|
|
||||||
log_date() {
|
log_date() {
|
||||||
echo "[$(date +%Y-%m-%d %H:%M:%s)]"
|
echo "[$(date +"%Y-%m-%d %H:%M:%S")]"
|
||||||
}
|
}
|
||||||
process_name() {
|
process_name() {
|
||||||
basename $0
|
basename $0
|
||||||
|
@ -40,7 +40,7 @@ debug() {
|
||||||
info() {
|
info() {
|
||||||
msg="${1:-$(cat /dev/stdin)}"
|
msg="${1:-$(cat /dev/stdin)}"
|
||||||
if [ "${LOGLEVEL}" -ge 6 ]; then
|
if [ "${LOGLEVEL}" -ge 6 ]; then
|
||||||
tty -s && echo "$(log_date) INFO $(process_name)${msg}"
|
tty -s && echo "$(log_date) INFO $(process_name) ${msg}"
|
||||||
logger -t bkctld -p daemon.info "$(process_name) ${msg}"
|
logger -t bkctld -p daemon.info "$(process_name) ${msg}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue