SA-MP Forums Archive
Keeping Server Alive (Linux) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Keeping Server Alive (Linux) (/showthread.php?tid=354654)



Keeping Server Alive (Linux) - bhaveshnande - 27.06.2012

I recently got a VPS and tried hosting my SAMP server which I created about a year ago.
I can start the server by cd to /my/server/dir/ and then ./samp03svr but cannot keep it alive. It closes as soon as I close my PuTTY SSH terminal. There are three methods to keep the server alive on https://sampwiki.blast.hk/wiki/Linux_Server . I wanted to try the third one because it was simple and just used 2 .sh files.

I placed gtaserver.sh in my /usr/local/bin directory and my startgtaserver.sh in /my/svr/dir/ also I made all .sh files executable and changed path in both my scripts.

The page states to use the new command gtaserver start, gtaserver stop and gtaserver restart to start, stop and restart the server but when I do so, the terminal returns "Command not found: gtaserver".

I tried using cd /usr/local/bin then ./gtaserver.sh start/stop/restart but it returns "Need to be a terminal"

Whats wrong?


Re: Keeping Server Alive (Linux) - uchiha26 - 27.06.2012

use " screen ./samp03svr " and after ctrl+a+d to close the terminal...(just stop putty and the server wll work fine )

to reopen the terminal use " screen -rr "


Re: Keeping Server Alive (Linux) - bhaveshnande - 28.06.2012

Quote:
Originally Posted by uchiha26
Посмотреть сообщение
use " screen ./samp03svr " and after ctrl+a+d to close the terminal...(just stop putty and the server wll work fine )

to reopen the terminal use " screen -rr "
Works thank you. And how do I restart/close the server without restarting the entire VPS?


Re: Keeping Server Alive (Linux) - Whitetiger - 28.06.2012

you should use this command to start it, as stated on the wiki

Код:
nohup ./samp03svr &
but if the technique above works for you, then great.

what linux version are you using?

anyway, in ubuntu, use "ps ux" to get a list of processes, and then type "kill [process id]" to end a process, you should pick the process id of "samp-server" and kill it. then you will need to start it again, the same way you started it the first time.

(all this can be found on ****** btw)


Re: Keeping Server Alive (Linux) - uchiha26 - 28.06.2012

you can by screen -rr and then pres ctrl+c


Re: Keeping Server Alive (Linux) - bhaveshnande - 28.06.2012

Quote:
Originally Posted by whitetigerswt
Посмотреть сообщение
you should use this command to start it, as stated on the wiki

Код:
nohup ./samp03svr &
but if the technique above works for you, then great.

what linux version are you using?

anyway, in ubuntu, use "ps ux" to get a list of processes, and then type "kill [process id]" to end a process, you should pick the process id of "samp-server" and kill it. then you will need to start it again, the same way you started it the first time.

(all this can be found on ****** btw)
Quote:
Originally Posted by uchiha26
Посмотреть сообщение
you can by screen -rr and then pres ctrl+c
Ok, thank you


Re : Keeping Server Alive (Linux) - R@f - 28.06.2012

A very easy method to kill your server (or any other process) is using "htop". It's a process management tool (CLI) and it's very intuitive (select the process and press F9).


Re: Re : Keeping Server Alive (Linux) - bhaveshnande - 29.06.2012

Quote:
Originally Posted by R@f
Посмотреть сообщение
A very easy method to kill your server (or any other process) is using "htop". It's a process management tool (CLI) and it's very intuitive (select the process and press F9).
Yup, htop is quite useful and easy to use.