Hello PocketMine ! I am holding one server using Windows Server 2012. This server will restart automatically in an hour. (using plugin RestartMe, the start.cmd is the RestartMe version) When the server restarted, the mintty.exe still existed. So I simply add the command "/f /im mintty.exe" in the start.cmd to kill the software. But when I tried to hold 2 or more servers, this command will kill the other servers. Also, the start.cmd will not restart server. The two servers have different ports and names. How to fix that? Sorry, bad English.
best solution: do not use windows second emergency-i-d-k-how-to-install-linux approach: is the server correctly shutting down? or is the php process stuck (probably at command reader, WINDOWS SUCKS). If the php process is stuck the only hack would be to let the server write their pids in a text file and then let the start.cmd read that out and directly kill only that php pid. If mintty.exe is stuck itself (what i don't think is what happens here) there is no quick solution (can we get the pid when we start a process?)
Well, that's a problem... Because when I do that, the second server will be killed, too. (Killing all php.exe will kill all servers at the same time)
Or add a automatic restart. Code: @echo off :start TITLE Pocketmine-MP: Auto restart cd /d %~dp0 :loop echo Checking if server is online... PING 127.0.0.1 -n 3 >NUL netstat -o -n -a | findstr 0.0:25565>nul if %ERRORLEVEL% equ 0 ( echo Server is running. goto :loop ) ELSE ( call :StartPM goto :Exit call :StartPM ) goto :EOF :StartPM if exist bin\php\php.exe ( set PHP_BINARY=bin\php\php.exe ) else ( set PHP_BINARY=php ) if exist PocketMine-MP.phar ( set POCKETMINE_FILE=PocketMine-MP.phar ) else ( if exist src\pocketmine\PocketMine.php ( set POCKETMINE_FILE=src\pocketmine\PocketMine.php ) else ( echo "Couldn't find a valid PocketMine-MP installation" pause exit ) ) if exist bin\php\php_wxwidgets.dll ( %PHP_BINARY% %POCKETMINE_FILE% --enable-gui %* ) else ( if exist bin\mintty.exe ( start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %* ) else ( %PHP_BINARY% -c bin\php %POCKETMINE_FILE% %* exit ) ) goto :loop goto :EOF :Exit exit Use this as the start.cmd in the code you will notice this Code: netstat -o -n -a | findstr 0.0:25565>nul Change the port of that to any port you want. and I suggest using this plugin. https://forums.pocketmine.net/plugins/automatic-server-restarter.903/
I tried to use this way, but it didn't work well. The zombie mintty.exe still alive (The server was closed, but the mintty.exe still survived) What I want to do is to kill the target mintty.exe and hold multiple servers. (Not just kill them all) (Maybe when server is running, record the PID which uses the target port. When server is closed, kill the target PID) But I don't know how to do that in a .bat. Any help?
Try kill them by their directory runned by that is if you use PM PHP Bin you could kill it by path example killing all processes running from path /thunder33345/servers/server1/* if that is even possible to do so