Fixing stale pidfile issue when docker dies abruptly

Signed-off-by: Mike Leone <mleone896@gmail.com>

fixing indent

Signed-off-by: Mike Leone <mleone896@gmail.com>
This commit is contained in:
Mike Leone 2015-01-22 10:22:40 -05:00
parent 3c77e7d634
commit 05d04843e6
1 changed files with 9 additions and 0 deletions

View File

@ -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