Merge branch 'master' of https://git.oopen.de/script/monitoring
This commit is contained in:
commit
e4fb8c7f0e
@ -885,6 +885,13 @@ stop_postgresql() {
|
|||||||
break
|
break
|
||||||
fi
|
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
|
kill $PSQL_MAIN_PID > /dev/null 2>&1
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
@ -907,6 +914,13 @@ stop_postgresql() {
|
|||||||
error "Found processes 'postgres:'."
|
error "Found processes 'postgres:'."
|
||||||
info "Going to kill 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
|
for _PID in $CHILD_PIDS ; do
|
||||||
kill $_PID > /dev/null 2>&1
|
kill $_PID > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user