( search forums )
Linux Server and SSH
Soldat Forums - Server Talk - Server Help
blan
June 24, 2004, 4:21 pm
I connect to my Linux server through SSH. The problem is that if I logout of the ssh the server goes down. Is there anyway to keep it running without having to be logged onto ssh?

n00bface
June 24, 2004, 5:45 pm
make a script that you can execute so you just type something like "./run" and run it in the background...then you can close SSH and it will be up for almost 3 hours..then it will crash...not cuz of the way you ran it tho..

blan
June 24, 2004, 7:18 pm
ehhh. What?

I run it doing ./soldatserver

n00bface
June 25, 2004, 12:06 am
i guess you don't understand what i mean, so i don't want to help you..!

blan
June 25, 2004, 4:24 am
que pela bicho te hicieron.

bitch.

palloco
June 25, 2004, 8:24 am
To run in the background the command was typing &. I may check this at home with a manual.

n00bface
June 25, 2004, 8:39 am
& doesnt keep it running for more than ~20 minutes after it's closed..it always dies out after the &..

my old host made a script that could be done through ./run, and it would run the soldatserver in the background...i dont have the script anymore tho..i was hoping blan was smart enough to know what i was talking about tho..cuz i wasn't..oh well..

Zickell
June 25, 2004, 2:02 pm
in linux try screen -S soldat ./soldatserver : this opens a new screen and and stays open untill u shut it and the app will keep running
ctrl and a+d will get u out of the screen and back into the main bash
screen -r soldat will get u back into the soldat screen
and screen -list will give u a complete list
and kill -9 pidnumber will kill the screen
and screen -wipe will clean all dead screens that u killed with kill -9
also try screen -help
so this is what u should type

screen -S soldat ./soldatserver then ctrl and a+d

blan
June 25, 2004, 2:38 pm
thanks zickell. unfortunately I have to be root to run that, more specifically I get "Must run suid root for multiuser support" so I cant do it.

I knew of the & sign but havent tried it, might as well.

Dathker
June 25, 2004, 11:11 pm
heh ill try and help after i burn the install distro for alinux and install it on my computer for a dual boot

blan
June 27, 2004, 3:27 am
I think its pretty much a feature that the linux server does not have. *adds to list*

n00bface
July 10, 2004, 2:20 am
umm..i was trying this on my server, and i couldnt figure out how the hell..but then i figured out! the answer is pretty obvious..

in the readme file that came with the server, it said to use the nohup command..but when you close the SSH client, the server closes too..but, if you run nohup with & at the end, the server stays up! YAY..


so (for example): nohup /usr/server/soldatserver &


woo. yay.

Drama
July 10, 2004, 11:22 am
how long it stays up?

n00bface
July 10, 2004, 3:17 pm
mine is still up now..after 12 hours of SSH being closed

Dathker
July 10, 2004, 3:36 pm
nohup /usr/server/soldatserver &

CHIBI TAUGHT ME THAT YAY

Drama
July 10, 2004, 7:14 pm
i love you guys (make sticky or add to the faq, this really helps ppl)

sativa
July 11, 2004, 1:17 am
quote:Originally posted by blan
que pela bicho te hicieron.

bitch.


do not shout and mock noobafce or you shall face and fear me

Shanesan
July 11, 2004, 6:33 am
You guys kick ass. Thank you VERY MUCH.

Add this to the FAQ and DEFINATELY A STICKY! I've been trying to get that running right all night! Woo! :)

Drama
July 11, 2004, 12:20 pm
Which is better: nohup or screen ?

what's their difference?

b00stA
July 11, 2004, 1:21 pm
I have no clue about Linux commands, but "man nohup" and "man screen" might help you.

Master Fox
July 19, 2004, 6:03 pm
or there is

nohup ./soldatserver 1>/dev/null 2>&1 &
echo "Soldat Server Now Runnning"

put that into a file with out a extension eg. file not .txt or exe

and then type ./<filename

then it should run perfectly for ever

Lemon
September 10, 2004, 7:52 pm
fox
how to stop it......
or restart the server

n00bface
September 11, 2004, 2:01 am
To stop the server -- "ps aux" look for soldat server and "kill thesoldatserverpid", or simply "killall soldatserver" (minus the quotes).

And there is no way to restart it, just stop then start.

Burn
September 11, 2004, 3:25 am
quote:Originally posted by Lemon
fox
how to stop it......
or restart the server


To stop:
killall soldatserver

To start:
You already know how to do that :)

Lemon
September 20, 2004, 1:34 pm
One more Question.
Any solution that i can log the status of the server in a file?
i know it can work in background right now
but i cant check the status of it

I would like to suggestion to write a script that log all monitoring status in a file.
It's great

n00bface
September 20, 2004, 1:44 pm
I'm not exactly sure what you mean, but in the logs directory of the soldat installation is a file called 'consolelog-*.txt' (the * is the latest number) and that displays the chat / flag captures / scores, and then there is also a gamestat.txt file which shows the players playing, their score, their ping, map, timeleft, etc.

Jae
December 16, 2004, 8:08 pm
Thats easy, just when loged into your SSH Soldat Dir type:

nohup ./soldatserver

Exit out and notice its still up.

Now to restart the server or stop it just simply log back in and type:
ps -cef

You should see somthing simular to:
root 8722 1 - 30 14:56 ? 00:00:02 ./soldatserver


Notice "8722" Thats the PID Number, YOull need this to stop the server,
Now since you know your PID number type:
kill -term 8722

then you can just start it again...

Its easier than it sounds

-Jae

ziekke
January 8, 2005, 12:31 pm
For those wanting to run a server in the background, run it in a screen (
http://www.gnu.org/software/screen/) session.

You type "screen" to create a new session, and then you just run the server.

Here are the useful key combos for screen (the letters are case sensitive.. ("A" != "a")):
[CTRL+a, d] to detach from a screen session and log out.
[CTRL+a, c] to make a new screen window
[CTRL+a, n] cycle to the next screen window
[CTRL+a, p] cycle to the previous screen window

Once you have detached, you can reconnect to your screen session by running `screen -r`

See `screen --help` and [CTRL+a, ?] for more information regarding the usage of screen.

edit: An added note, doing it this way you can also see everything the server is doing live, without having to read the log files.