This commit is contained in:
Christoph 2018-12-28 19:28:17 +01:00
commit e4fb8c7f0e

View File

@ -885,6 +885,13 @@ stop_postgresql() {
break
fi
# - Don't Start/Stop/Kill Services if package management is running (apt,aptitude,dpkg)
# -
if ( [[ "${os_dist,,}" = "debian" ]] || [[ "${os_dist,,}" = "ubuntu" ]] ) \
&& $(lsof /var/lib/dpkg/lock >/dev/null 2>&1) ; then
warn "It seems that package management (apt,dpkg) is running. Exiting '${FUNCNAME[0]}' now.."
return 1
fi
kill $PSQL_MAIN_PID > /dev/null 2>&1
sleep 2
@ -907,6 +914,13 @@ stop_postgresql() {
error "Found processes 'postgres:'."
info "Going to kill processes 'postgres:'.."
# - Don't Start/Stop/Kill Services if package management is running (apt,aptitude,dpkg)
# -
if ( [[ "${os_dist,,}" = "debian" ]] || [[ "${os_dist,,}" = "ubuntu" ]] ) \
&& $(lsof /var/lib/dpkg/lock >/dev/null 2>&1) ; then
warn "It seems that package management (apt,dpkg) is running. Exiting '${FUNCNAME[0]}' now.."
return 1
fi
for _PID in $CHILD_PIDS ; do
kill $_PID > /dev/null 2>&1
done