Before version 1.7.2 I was able to check if the server was running by using a shellscript that checked if server.log.lck
was in the Minecraft server directory. I am running multiple servers via screens, so I want to be sure that the server is not running before I start it.
Because 1.7.2 introduced a new logging system, this is not possible anymore.
I use a shell script where I have an unique port and an unique screen name for each server.
How can I now determine if the server is running?
ps
isn't a trivial option, because you have more than one process.ps
intogrep
and check that way? Also, there might be another lock file that you can check.ps
and there's nothing to grep for. I believe you can run using a full path to the jar instead of relative and then you can grep on the directories in the path, but I don't have a system to test that behaviour's reliability on. (My nearest *nix is OS X, and it notoriously tweaks command line tools in ways that make them subtly different.)