Multiple server launching (from single file?)

Post your questions here
User avatar
Wahlamt
Posts: 6732
Joined: Mon Sep 13, 2010 3:15 pm
Team: MLG Compton
Location: Sweden
Contact:

Multiple server launching (from single file?)

Postby Wahlamt » Fri Dec 15, 2017 4:19 am

This question is aimed at people who run a few different servers on a Linux based system.

I currently have a few different servers up and running (5-6 ish) where I have the standard "folder" setup. Everything server related in the folder, except trackinfos where as I have them

Code: Select all

../shared/trackinfos/*


However as soon as a server update comes out, I have to change a lot of them, which is both consuming and confusing. The servers files are named like "mxserverNAT" (nationals) and "mxserverSX" for the ease of knowing which file (when running) is which, so I can differentiate them when I execute

Code: Select all

top -bc | grep mxserver
so I can see which PID to kill.

To start the server I do

Code: Select all

./run
which contains the code

Code: Select all

nohup ./mxserverSX --args-file serverargs.txt > consolelog.log 2>&1&


Would it be possible to do something like:
nohup ./../mxserverCOLLECTIVE --args-file serverargs.txt > consolelog.log 2>&1&

where "mxserverCOLLECTIVE" is the one and only file used to start all servers. Also in this scenario, it'd be important to tell the difference from each instance running in the "top" command, which is why I name them differently now. So, could this be done, still being able to differentiate which instance is which of the server?

jlv
Site Admin
Posts: 12886
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Multiple server launching (from single file?)

Postby jlv » Sat Dec 16, 2017 2:18 am

I have separate scripts for each server (run00.sh, run01.sh etc.). To see which script started which server I use "ps axf". If you don't want to use the extra shell scripts, you could use pwdx to see the current directory for a specific PID.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

User avatar
Wahlamt
Posts: 6732
Joined: Mon Sep 13, 2010 3:15 pm
Team: MLG Compton
Location: Sweden
Contact:

Re: Multiple server launching (from single file?)

Postby Wahlamt » Sat Dec 16, 2017 11:50 am

Thanks for the reply! Will definitely look into that once I get some spare time.


Return to “Help / Troubleshooting”

Who is online

Users browsing this forum: No registered users and 4 guests