summaryrefslogtreecommitdiff
path: root/tools/bin/restart-pid
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-12-14 10:32:08 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-12-14 10:32:08 -0800
commite34e49d3064640e01305549413c862ee0a7a79aa (patch)
tree863efe11d5aa9a079188df2c9f0c112c93e13074 /tools/bin/restart-pid
parent45185408935a56197c308da7ae5d27d72fe06917 (diff)
downloadserverdata-e34e49d3064640e01305549413c862ee0a7a79aa.tar.gz
serverdata-e34e49d3064640e01305549413c862ee0a7a79aa.tar.bz2
serverdata-e34e49d3064640e01305549413c862ee0a7a79aa.tar.xz
serverdata-e34e49d3064640e01305549413c862ee0a7a79aa.zip
Change tools/ to a submodule
Diffstat (limited to 'tools/bin/restart-pid')
-rwxr-xr-xtools/bin/restart-pid44
1 files changed, 0 insertions, 44 deletions
diff --git a/tools/bin/restart-pid b/tools/bin/restart-pid
deleted file mode 100755
index 498bdcc4..00000000
--- a/tools/bin/restart-pid
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash -e
-# do nasty work here
-# The job of this script is twofold:
-# 1. kill the existing server, if it exists
-# 2. write the PID file and start the new server
-
-source restart-config
-
-PROCESS=$1
-
-if test -f $PROCESS.pid
-then
- # if the process ID may change its name (e.g. via exec),
- # then remove '$PROCESS' on the following line
- PID=$(pgrep $PROCESS -u $UID -F $PROCESS.pid || true)
- if test -n "$PID"
- then
- kill $PID
- echo waiting for $PID to die so I can restart $PROCESS
- while
- ! kill -s 0 $PID
- do
- echo -n .
- sleep 1
- done
- # This shouldn't be necessary, but somehow is
- sleep 2
- echo
- else
- echo $PROCESS.pid does not point to a valid process - nothing killed
- fi
-else
- echo No PID file $PROCESS.pid found - nothing killed
-fi
-
-if test -z "$VERBOSE"
-then
- exec >/dev/null 2>&1
-fi
-
-{
- # $$ is not reset in subshells
- exec sh -c 'echo $$ > '$PROCESS'.pid; exec ./'$PROCESS
-} &