- Home /
Headless linux server
Hey, I can start server in -batchmode and Putty console just hangs there.
 Set current directory to /server_linux/sl
 Found path: /server_linux/sl/server_linux.x86
 Mono path[0] = '/server_linux/sl/server_linux_Data/Managed'
 Mono path[1] = '/server_linux/sl/server_linux_Data/Mono'
 Mono config path = '/server_linux/sl/server_linux_Data/Mono/etc'
And it's all ok.
But how can I start 3 instances of unity application?
Answer by nastasache · Nov 14, 2013 at 05:47 PM
As normal user, cd to your game location and try this command to see if working:
$ xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:24' ./server_linux.x86 > ./server_linux.log &
To run multiple instances of Unity Editor:
- open project once and set Edit -> Project Settings -> Player -> Per-Platform Settings - Settings for PC, Mac & Linux Standalone -> check "Run In Background" 
- close the project and copy it (full) in diferent locations 
- for each location, create a .bat files like (change paths accordingly with Unity instalation and your folders): 
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -projectPath "path_to_your_project_folder"
- Execute each .bat file 
Some more possible useful details related with running under Linux you may find here (it's the doc of FPShootNet project under Unity Asset Store).
Hi mzlatar,
I tested on my own, starting 2 instances of my game server on remote machine using putty. Both game are kept up after I close putty.
Try this:
- login as root with putty, then su as regular user (launch games/script as regular user) 
- be sure use & (send process to the backgroud) at the end of commands 
- use different ports for each game listenPort (on Network.InitializeServer) 
- be sure ports are open for udp. 
There may be also other reasons machine related hanging your instances but I don't know exactly the way, machine and commands you use (my server is a dedicated Ubuntu server and I start with commands I said before - just like server_linux2.x86 for second second game server - the only difference from first one is a different listen port).
You may try also to use nohup command in front of command or use screen command (I did not tested with these since it's working with simple "&").
Iulian
Answer by mzlatar · Nov 14, 2013 at 11:17 PM
Hey nastasache thanks for your answer.
Run in background option is checked and I figured out how to run 3 linux application. I am doing this on GoGrid's linux servers. I run putty and connect to them, run a shell skript that fire up 5 instances of server but it hangs, console output is code I pasted in first question and if I close putty that unity instances will also be closed.
What can I do to run them and to keep running even when I close putty connection?
when u close putty your ending the session. try using a screen with "screen -S name" and when the servers started detach from the screen (ctrl+a d) then u can access the screen again with "screen -x name". other wise you need to make a service and thats a lot more involved. this is a good example with $$anonymous$$ecraft
Your answer
 
 
             Follow this Question
Related Questions
Linux game server 1 Answer
Console Application 0 Answers
Unity networking tutorial? 6 Answers
Reducing server-side application size 0 Answers
running servers for networked games 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                