Page 1 of 1

Multiple server launching (from single file?)

Posted: Fri Dec 15, 2017 4:19 am
by Wahlamt
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?

Re: Multiple server launching (from single file?)

Posted: Sat Dec 16, 2017 2:18 am
by jlv
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.

Re: Multiple server launching (from single file?)

Posted: Sat Dec 16, 2017 11:50 am
by Wahlamt
Thanks for the reply! Will definitely look into that once I get some spare time.