Skip to content

Commit

Permalink
Update groonga-httpd-restart.in
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob16bit committed Jun 19, 2015
1 parent 50cb77a commit 3caaca4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions data/scripts/groonga-httpd-restart.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ elif [ -f /etc/sysconfig/${SERVICE_NAME} ]; then
. /etc/sysconfig/${SERVICE_NAME}
fi

OLD_PID_FILE=${PID_FILE}.oldbin

wait_until () {
for n in $(seq ${TIMEOUT}); do
if "$@"; then
Expand Down Expand Up @@ -74,6 +76,11 @@ fi
OLD_PID=$(cat ${PID_FILE})
start_master ${OLD_PID}

if ! wait_until [ -f ${OLD_PID_FILE} ]; then
echo "Failed to create old PID file: <${PID_FILE}>"
exit 1
fi

if ! wait_until [ -f ${PID_FILE} ]; then
echo "Failed to start new groonga-httpd master."
exit 1
Expand All @@ -97,3 +104,4 @@ fi
stop_master ${OLD_PID}
exit $?


0 comments on commit 3caaca4

Please sign in to comment.