bkctld-rm: state the age of the process when killing it

This commit is contained in:
Jérémy Lecour 2020-04-20 23:31:39 +02:00 committed by Jérémy Lecour
parent ea140f6137
commit 11bb59831c

View file

@ -19,7 +19,9 @@ kill_or_clean_lockfile() {
pkill -9 --parent "${pid}"
# Kill the parent
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}' has been killed (was running since ${lockfile_date})"
else
warning "Process not found at PID \`${pid}'. Ignoring lock file \`${lock_file}'."
fi