mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #10277 from mleone896/rhinit_dead_pid_file
Fixing stale pidfile issue when docker dies abruptly
This commit is contained in:
commit
6da5b88bed
1 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,8 @@ prestart() {
|
||||||
start() {
|
start() {
|
||||||
[ -x $exec ] || exit 5
|
[ -x $exec ] || exit 5
|
||||||
|
|
||||||
|
check_for_cleanup
|
||||||
|
|
||||||
if ! [ -f $pidfile ]; then
|
if ! [ -f $pidfile ]; then
|
||||||
prestart
|
prestart
|
||||||
printf "Starting $prog:\t"
|
printf "Starting $prog:\t"
|
||||||
|
@ -97,6 +99,13 @@ rh_status_q() {
|
||||||
rh_status >/dev/null 2>&1
|
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
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
rh_status_q && exit 0
|
rh_status_q && exit 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue