Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
game servers to run in background - ** init no good, ideas?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Sun Jan 18, 2004 7:37 am    Post subject: game servers to run in background - ** init no good, ideas? Reply with quote

Quote:
Hi,

noticed this in the use flags
Quote:
dedicated - Adds support for dedicated game servers


does anyone know what this use flag ACTUALLY does?

I'm looking to host a CS and DoD server, among other things..

cheers


EDIT:

I have now have CS and DoD servers working, however they need to be run from console.

is there a way I can
a) get them to start as a boot service / or after boot service - perhaps local.start ?
b) get them to run in the background, rather than taking up a console?

cheers!
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!


Last edited by taskara on Mon Jan 19, 2004 5:45 am; edited 5 times in total
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Sun Jan 18, 2004 7:54 am    Post subject: Reply with quote

also - any other flags one should include for a stage1 game server build?

perl... or anything like that?
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Sun Jan 18, 2004 11:49 am    Post subject: Re: game servers use flag Reply with quote

taskara wrote:
I'm looking to host a CS and DoD server

Last year, when I tried the ebuild in portage, I saw that the versions of some mods (adminmod for example) were outdated, so I just built everything from scratch ... you might want to check everything is up to date now, otherwise you'll have to do the very same thing.
_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Sun Jan 18, 2004 12:37 pm    Post subject: Reply with quote

thanks scout,

Steam server does not seem to be in the portage.. so I downloaded it.

I'll have to play with it myself and see if i can get it to work.. an ebuild would be nice though ;)

cheers
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Mon Jan 19, 2004 1:21 am    Post subject: Reply with quote

I have now have CS and DoD servers working, however they need to be run from console.

is there a way I can
a) get them to start as a boot service / or after boot service - perhaps local.start ?
b) get them to run in the background, rather than taking up a console?

cheers!
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
DopeGhoti
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 100
Location: Vermont, US

PostPosted: Mon Jan 19, 2004 3:34 am    Post subject: Reply with quote

taskara wrote:
is there a way I can
a) get them to start as a boot service / or after boot service - perhaps local.start ?
If you are good at cobbling shell scripts together, you can slap something together to put into /etc/init.d/ that you can set up with rc-update wasily enough.

taskara wrote:
b) get them to run in the background, rather than taking up a console?
I recommend 'screen', which is an excellent program that does that very thing, with the added benefit of being able to 'attach' to the process to interact with it, and 'detach' from it later to lave it chugging along. There's a great primer on screen here.
_________________
A proud member of the No post left unanswered Club!
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Mon Jan 19, 2004 4:36 am    Post subject: Reply with quote

great idea.. I'll see how I go!

cheers
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Mon Jan 19, 2004 5:22 am    Post subject: Reply with quote

anyone know how to pass options on an executable in an init script?

I can point my initscript to
Code:
/home/games/hlds_l/hlds_run


but I need to pass a whole bunch of options after it like:

Code:
/home/games/hlds_l/hlds_run -game cstrike -map de_dust +maxplayers 8 -autoupdate
etc

my init script complains that
Code:
start-stop-daemon: invalid option -- g


I tried with " " around the command, but then I get
Code:
start-stop-daemon: stat /home/games/hlds_l/hlds_run -game cstrike: No such file or directory


any ideas?
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
DopeGhoti
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 100
Location: Vermont, US

PostPosted: Mon Jan 19, 2004 5:27 am    Post subject: Reply with quote

try making a wrapper script. I had one on my HL server, for example, called hlserver.sh, that looked somehitng like:
Code:
#!/bin/bash
cd /usr/games/hlds_l/
./hlds_run -game-tfc -port 27015 +map well


Then, you just need to call hlserver.sh, and it passes the paramaters to hlds_run for you.

This was on my other server, though, which isn't a Gentoo box yet. :)
_________________
A proud member of the No post left unanswered Club!
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Mon Jan 19, 2004 5:43 am    Post subject: Reply with quote

DopeGhoti wrote:
try making a wrapper script. I had one on my HL server, for example, called hlserver.sh, that looked somehitng like:
Code:
#!/bin/bash
cd /usr/games/hlds_l/
./hlds_run -game-tfc -port 27015 +map well


Then, you just need to call hlserver.sh, and it passes the paramaters to hlds_run for you.

This was on my other server, though, which isn't a Gentoo box yet. :)


ahhh I think that did it.

I had already tried this, but in my mad rush trying a thousand things, I forgot
Code:
#!/bin/bash


I have created the init script, and it starts steam, however it still sits there in the console.. (which will stop the rest of the boot process)

Code:
games root # /etc/init.d/cstrike start
 * Starting counter-strike...
Auto detecting CPU
Using AMD Optimised binary.
Auto-restarting the server on crash
Could not locate steam binary:./steam, ignoring.

Console initialized.
scandir failed:/home/games/hlds_l/./valve/SAVE
scandir failed:/home/games/hlds_l/./platform/SAVE
Protocol version 47
Exe version 1.1.2.3/Stdio (cstrike)
Exe build: 19:55:53 Jan 13 2004 (2637)
STEAM Auth Server
couldn't exec language.cfg
Server IP address 192.168.0.9:27015
Downloading Security Module from Speakeasy.net ...
Completed downloading Security Module from Speakeasy.net
Server is in Secure Mode.
scandir failed:/home/games/hlds_l/./valve/SAVE
scandir failed:/home/games/hlds_l/./platform/SAVE

couldn't exec listip.cfg
couldn't exec banned.cfg
Adding auth server 65.73.232.251:27040
Adding auth server 65.73.232.253:27040
Adding master server 207.173.177.12:27010
Adding master server 207.173.177.11:27010


so I don't think init scripts are going to work :? any ideas?
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
DopeGhoti
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 100
Location: Vermont, US

PostPosted: Mon Jan 19, 2004 6:16 am    Post subject: Reply with quote

Try this for your script:
Code:
#!/bin/bash
#
#  Starts an HL server on a screen with the title
#  'hlserver' that can be attached for interacting with the server
#
#  To attach, type 'screen -r hlserver'.
#  To detach, press ^a, d
#
cd /usr/games/hlds_l/
screen -d -S hlserver ./hlds_run -game-tfc -port 27015 +map well

_________________
A proud member of the No post left unanswered Club!
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Mon Jan 19, 2004 6:22 am    Post subject: Reply with quote

DopeGhoti wrote:
Try this for your script:
Code:
#!/bin/bash
#
#  Starts an HL server on a screen with the title
#  'hlserver' that can be attached for interacting with the server
#
#  To attach, type 'screen -r hlserver'.
#  To detach, press ^a, d
#
cd /usr/games/hlds_l/
screen -d -S hlserver ./hlds_run -game-tfc -port 27015 +map well


made changes as per your suggestion, and result:
Code:
games root # cstrike
There is no screen to be detached matching hlserver.


do I have to configure screen first?
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
DopeGhoti
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 100
Location: Vermont, US

PostPosted: Mon Jan 19, 2004 6:31 am    Post subject: Reply with quote

No, I was just missing a switch.. make the following change:
Code:
screen -d -m -S hlserver ./hlds_run -game-tfc -port 27015 +map well


One thing you might want to do, though, is not run the server as root. HL is generally rather secure, but it's better safe than sorry. Make sure you have sudo emerged, make yourself a user for hlds (for example, hladmin), and then:
Code:
sudo -u hladmin screen -d -m -S hlserver ./hlds_run -game tfc -port 27015 +map well

_________________
A proud member of the No post left unanswered Club!
Back to top
View user's profile Send private message
taskara
Advocate
Advocate


Joined: 10 Apr 2002
Posts: 3763
Location: Australia

PostPosted: Mon Jan 19, 2004 7:00 am    Post subject: Reply with quote

great!

thank you so much for your help.. I'll see how I go, and report back.

cheers
_________________
Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer!
Back to top
View user's profile Send private message
DopeGhoti
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 100
Location: Vermont, US

PostPosted: Mon Jan 19, 2004 7:41 am    Post subject: Reply with quote

I'm glad to help! Let me know if there are any problems.
_________________
A proud member of the No post left unanswered Club!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum