first rotate the pid file then write the new PID to it
This commit is contained in:
parent
f71ef9f4fd
commit
8d4b01ed68
1 changed files with 1 additions and 1 deletions
|
@ -73,13 +73,13 @@ do
|
|||
$COMMAND &> "$SERVERBASE/logs/$LOG" &
|
||||
|
||||
PID=$!
|
||||
echo $PID > $SERVERBASE/current.pid
|
||||
echo "started $SERVER server with command: '$COMMAND' (revision: $REV, pid: $PID) logging to: $LOG"
|
||||
# create some convenient links
|
||||
ln -s "$SERVERBASE/logs/$LOG" "$LOG.$PID"
|
||||
rm -f $SERVERBASE/old.{log,pid}
|
||||
mv $SERVERBASE/current.log $SERVERBASE/old.log &> /dev/null
|
||||
mv $SERVERBASE/current.pid $SERVERBASE/old.pid &> /dev/null
|
||||
echo $PID > $SERVERBASE/current.pid
|
||||
ln -s "logs/$LOG" $SERVERBASE/current.log
|
||||
# wait for the server to terminate
|
||||
wait $PID
|
||||
|
|
Loading…
Add table
Reference in a new issue