Keeping Server Alive (Linux)
#1

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?
Reply
#2

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 "
Reply
#3

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?
Reply
#4

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)
Reply
#5

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

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
Reply
#7

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).
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)