Merge pull request #10277 from mleone896/rhinit_dead_pid_file
Fixing stale pidfile issue when docker dies abruptly Upstream-commit: 6da5b88bedf7d14c7efb25ae659cccd8980732a4 Component: engine
This commit is contained in:
@ -43,6 +43,8 @@ prestart() {
|
||||
start() {
|
||||
[ -x $exec ] || exit 5
|
||||
|
||||
check_for_cleanup
|
||||
|
||||
if ! [ -f $pidfile ]; then
|
||||
prestart
|
||||
printf "Starting $prog:\t"
|
||||
@ -97,6 +99,13 @@ rh_status_q() {
|
||||
rh_status >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
check_for_cleanup() {
|
||||
if [ -f ${pidfile} ]; then
|
||||
/bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile}
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
rh_status_q && exit 0
|
||||
|
||||
Reference in New Issue
Block a user