check_webservice_load.sh: dont't kill postgreSQL pids if packet management ist running.
This commit is contained in:
parent
336cdb3a4d
commit
d0457d22ea
@ -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