Jump to content

Server switching ports after restart


colklutz88

Recommended Posts

Anybody know why my epoch Panthera server would be switching ports every time it does an autorestart? I had it set to run on port 2303 in the .bat file, but so far it has ended up on 2325, and 2314, as well as others.

 

Its kind of irritating, the server is scripted and ready to be played on, but if the ports keep changing on me, then nobody will be able to find it in the server browser and set it as a favorite.

 

Thanks in advance for any help.

Link to comment
Share on other sites

you need to kill the process before starting up the server again otherwise it will launch and arma will just assign another port.

How are you handling your shutdown/restarts?

I'm using BEC with a scheduler that sends commands to both servers at the same time. My chernarus server starts properly on port 2302 every time, my panthera server uses the same .bat config as the chernarus server, I just edited the necessary info to make it point at the panthera server rather than chernarus. Just can't figure out why the chernarus server starts properly, on the correct port, but panthera doesn't.

Link to comment
Share on other sites

I'm using BEC with a scheduler that sends commands to both servers at the same time. My chernarus server starts properly on port 2302 every time, my panthera server uses the same .bat config as the chernarus server, I just edited the necessary info to make it point at the panthera server rather than chernarus. Just can't figure out why the chernarus server starts properly, on the correct port, but panthera doesn't.

 

How are you shutting down the server? With #shutdown in BEC, or through a .bat file?

Link to comment
Share on other sites

How are you shutting down the server? With #shutdown in BEC, or through a .bat file?

 

 

I am using a .bat file.  I went ahead and created 2 different folders of BEC, 1 for chernarus, and 1 for panthera, and also set each server to restart at a 1 hour offset, as in chernarus will restart, then 1 hour later panthera will restart.  Hopefully this might fix my issue, but idk, im just experimenting with it.

Link to comment
Share on other sites

Not sure if it makes a difference, but I have an entirely different directory for my 2 servers, as in, my chernarus server runs from \epochserver with its own set of game files from arma 2 and operation arrowhead, and my panthera server runs from \epochpantheraserver, again, with its own set of game files for arma 2, operation arrowhead, and the mod folders for epoch, panthera, and the epoch server.  Could that possibly be what is causing my problems?  Even setting up 2 entirely different folders and instances of BEC, with offset server restarts didn't solve the issue.  When I manually run the .bat files to restart the servers they both start properly on the correct ports, but when they are auto-restarted with BEC the panthera server switches its port, I have been looking at the BEC configs and everything looks correct, so I am fairly sure that it is not the issue, but I could be wrong, still a little new with BEC.

 

Hope that new information helps someone figure out what my issue could be caused from.

 

Thanks for all the input so far.

Link to comment
Share on other sites

ARMA will choice a random(ish) port is the specified port is already in use

 

Yeah, I was aware of that, but when i manually trigger the restart.bat files, the servers start fine, and on the correct ports, it is only jacked up when it is auto-restarted by BEC

 

you don't need a second set of arma2/arma2oa files to run multiple servers.

 

can you post your .bat please?

 

Here is the restart.bat, both servers are identical, except for the directories.  Also, I figured I could have both servers in the same directory, but how do I specify 2 different server pbo's?

 

@echo off
echo.
echo KILL arma2oaserver.exe
set serverkill="C:\epochpantheraserver\Expansion\beta"
cd /d %serverkill%
taskkill /im arma2oaserver.exe
echo.
echo Kill Bec.exe
set beckill="C:\Users\Administrator\Desktop\Bec"
cd /d %beckill%
taskkill /im Bec.exe
 
timeout 20
 
echo.
echo Starting Dayz Server
:: start the server..
set dayzpath="C:\epochpantheraserver\"
cd /d %dayzpath%
start "" "DayZ_Epoch_instance_16_panthera.bat"
echo.
echo Starting Bec
timeout 10
:: start bec
set becpath="C:\Users\Administrator\Desktop\Bec2"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg
echo.
echo Server Started 100%
 
cls
@exit
Link to comment
Share on other sites

This happens when the arma 2 server doesnt shut down correctly and starts storing itself in the background processes. This can lead to the new sever having a new port. I solved this by using FireDaemon, which already puts the servers as a background process.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...