I am using docker to create a tcserver instance and it is successfully stopped when I do
./tcruntime-ctl.sh stop
However, the instance is not successfully restarted when I do
./tcruntime-ctl.sh run
The reason being that PID file(PID=1) still present and not deleted
Please note that I am running the tcserver instance as a foreground process by using the run command
If the error is simply that there is a vestige pidfile from a previous run, a workaround can be to remove the pidfile before invoking the tcruntime-ctl.sh
script. Since the the lifespan of the tcServer instance is related to that of the docker container, it can be safely assumed the process referred to in the pidfile has previously exited. You could write your own script that cleans up prior to exec
ing tcruntime.sh
, or prepend something like the following:
#!/bin/sh
pidfile=$(dirname $0)/../logs/tcserver.pid
if [ -f $pidfile ] ; then
rm $pidfile
fi