Skip to content

Commit

Permalink
Read File::Pid::Quick pidfiles properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Rodland committed Aug 17, 2010
1 parent 4817dd0 commit bae442e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cat-psgi-init
Expand Up @@ -52,8 +52,12 @@ fi
PERL5LIB="$APPDIR/lib"${PERL5LIB:+":"}$PERL5LIB
export PERL5LIB

getpid() {
awk '{ print $1 }' "$PIDFILE"
}

check_running() {
[ -s $PIDFILE ] && kill -0 $(cat $PIDFILE) >/dev/null 2>&1
[ -s $PIDFILE ] && kill -0 $(getpid) >/dev/null 2>&1
}

check_compile() {
Expand Down Expand Up @@ -127,7 +131,7 @@ restart() {
reload() {
log_daemon_msg "Reloading $APPNAME" $UNIXNAME

[ -s $PIDFILE ] && kill -HUP $(cat $PIDFILE) >/dev/null 2>&1
[ -s $PIDFILE ] && kill -HUP $(getpid) >/dev/null 2>&1
log_end_msg $?
return $?
}
Expand Down

0 comments on commit bae442e

Please sign in to comment.