AAO25.com

Assist => Support => Topic started by: zibi on Tuesday, April 28, 2020, 07:26:39 AM

Title: How to make the game server open all the time?
Post by: zibi on Tuesday, April 28, 2020, 07:26:39 AM
Hello,

I have made an server. But I have problem because I was setting server through SSH (PuTTy), everything working but for this server to work all the time I need to have PuTTy running in the background. After turning PuTTy off, the server shuts down. How to set it so that the server works all the time.

The server was set up on VPS Linux
Polish Server: 185.243.54.49:1716 Oldschool Boy
Title: Re: How to make the game server open all the time?
Post by: teddy_grizzly_bear on Tuesday, April 28, 2020, 07:58:14 AM
Look into tmux or screen.
Title: Re: How to make the game server open all the time?
Post by: hitman on Tuesday, April 28, 2020, 10:14:24 AM
Look into tmux or screen.

At first I thought so too, but now I use systemd service, which makes it a breeze to stop start restart the server. Also view the log real time.

Put this in /etc/systemd/system/aao25.service

Code: [Select]
[Unit]
Description=America's Army

[Service]
ExecStart=<path to your server-bin> GLOBAL <mapname>


Then just:
Code: [Select]
sudo systemctl start aao25
To view the log:
Code: [Select]
sudo journalctl -u aao25
Title: Re: How to make the game server open all the time?
Post by: zibi on Tuesday, April 28, 2020, 12:22:38 PM
I cannot find can you put me here all source by cd /sample/sample/sample ?

edit/// ok I found but there is no such file like aao25.service
Title: Re: How to make the game server open all the time?
Post by: hitman on Tuesday, April 28, 2020, 14:05:41 PM
I cannot find can you put me here all source by cd /sample/sample/sample ?

edit/// ok I found but there is no such file like aao25.service

You need to create it with the code that I gave you inside as a text. You can use "nano" to do it like so:
Code: [Select]
sudo nano /etc/systemd/system/aao25.service
Then you need to know the path to your AA installation and choose a map. After you finish editing the file, save it and I think you should restart server, don't remember exactly.
Title: Re: How to make the game server open all the time?
Post by: Possessed on Tuesday, April 28, 2020, 16:34:27 PM
simple exemple of how to run a server from putty shell and leave it running in the background, even after you close the putty window:
Code: [Select]
server-bin GLOBAL Bridge &>/dev/null &add
Code: [Select]
&>/dev/null & to the end of the command and the program will run in the brackground.
you might have to add
Code: [Select]
disown after the command, if running from a shell script.