View Full Version : Running HLDS In Background
JustGags
04-03-2004, 01:34 PM
I currently start HLDS by establishing an SSH connection to my dedicated server and starting it up. However, if I close my SSH connection, HLDS also closes. Would work / be harmful to run HLDS at startup from my /etc/rc.local file?
do this
screen -A -m -d -S cs ./hlds_run -game cstrike the rest of ur commands
itll run in backgroudn and when u logou before u close the ssh connection its still up...
to view it do screen -r cs
to detatch again do ctrl a then ctrl d
unbonami
04-03-2004, 03:31 PM
what do those commands do:
-A -m -d -S cs ?
i just run:
screen ./hlds_run...
then ctrl+A and ctrl+D to close screen
and screen -x to come back
QwertyAccess
04-03-2004, 06:14 PM
im not sure right now but it tells screen to reboot the server if it crashes or something and cs is the name of it ex screen -x cs opens the screen named cs.
Luddite
04-08-2004, 08:19 PM
screen --help
or
man screen
for information on what the switches do.
Likewise, you can start your process as screen -dmS cs ./hlds_run blah blah blah and avoid having to ctrl-a, d to shell out of the screen session, useful if you are starting it from a startup script.
Master Ruthless
04-08-2004, 10:44 PM
For those who don't RTFM:
[root@darkstar root]# screen --help
Use: screen [-opts] [cmd [args]]
or: screen -r [host.tty]
Options:
-a Force all capabilities into each window's termcap.
-A -[r|R] Adapt all windows to the new display width & height.
-c file Read configuration file instead of '.screenrc'.
-d (-r) Detach the elsewhere running screen (and reattach here).
-dmS name Start as daemon: Screen session in detached mode.
-D (-r) Detach and logout remote (and reattach here).
-D -RR Do whatever is needed to get a screen session.
-e xy Change command characters.
-f Flow control on, -fn = off, -fa = auto.
-h lines Set the size of the scrollback history buffer.
-i Interrupt output sooner when flow control is on.
-l Login mode on (update /var/run/utmp), -ln = off.
-list or -ls. Do nothing, just list our SockDir.
-L Terminal's last character can be safely updated.
-m ignore $STY variable, do create a new screen session.
-O Choose optimal output rather than exact vt100 emulation.
-p window Preselect the named window if it exists.
-q Quiet startup. Exits with non-zero return code if unsuccessful.
-r Reattach to a detached screen process.
-R Reattach if possible, otherwise start a new session.
-s shell Shell to execute rather than $SHELL.
-S sockname Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title Set title. (window's name).
-T term Use term as $TERM for windows, rather than "screen".
-U Tell screen to use UTF-8 encoding.
-v Print "Screen version 3.09.13 (FAU) 5-Sep-02".
-wipe Do nothing, just clean up SockDir.
-x Attach to a not detached screen. (Multi display mode).
-X Execute <cmd> as a screen command in the specified session.
[root@darkstar root]#
Also...
nohup ./steam <your server switch crap here> &
works if you don't have screen installed for some reason.
Outbreak
06-16-2004, 12:16 AM
how do you check all the screened processes, like whats the command? I think i forgot what i named my process...
Outbreak
06-16-2004, 07:08 PM
bump
JustGags
06-16-2004, 10:39 PM
Just do:
screen -r
If you just have one, it will resume it, if you have more than one it will show you a list with the names.
Dredster
06-17-2004, 11:44 PM
Originally posted by Outbreak
how do you check all the screened processes, like whats the command? I think i forgot what i named my process...
screen -list should show you all screen processes that you own.
Serialkilla1
02-19-2005, 06:15 AM
Hi, I had the same problem. So I am trying to use the screen command but my server doesn't recognise it. Any solutions? Do i have to install screen seperatly or what?
Thanks
Renegade.99
02-19-2005, 08:12 AM
You dont need screen installed. Just add an & to the end of your command line to send it into the background.
For example -
./hlds_run -game cstrike +map de_dust2 +maxplayers 18 -autoupdate &
You now dissconect from SSH and the server will continue to run.
To kill off the server type "ps -aux" in SSH, find its PID number and type "kill ****" , obviously replacing **** with the processes real PID.
Dredster
02-19-2005, 08:48 AM
You'll need screen if you ever want to get to the server console. Otherwise, your only options are to kill the process and restart it. Just nohup'ing it doesn't do you much good if you actually want to admin it from that system.
Screen is available for most *nix systems. It's package may be called screen or screens depending on your flavor of *nix.
Renegade.99
02-19-2005, 10:19 AM
You can access the consol with hlsw - http://www.hlsw.net
no need to log into ssh, bring up the screen etc.
And if u miss out the -autoupdate in the startup command line, a simple "quit" in the hlsw consol will shut down the process.
Serialkilla1
02-20-2005, 12:11 AM
Cool, I entered WHM (Webhost Manager) I found screen in the install rpm thingy. Installed it. Now its running in background woohoo cool thanks.
juzdme
05-28-2006, 08:37 PM
thanx for this info and *bump*
darkchemist
05-28-2006, 09:49 PM
Is it save to add this to your rc.local file? will it auto start the servers on boot?
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.