Maintaining the online server. Help!
#1

Hello members,
My problem concerns about whether there is any restarter server to samp, for Linux?
Is there such a thing? Please send me a quick answer, if possible...

Sorry about my English, but I'm Polish and do not know too much about it...

Reply
#2

All you need to use the program below is a Linux environment, and the possibility to use cron. This program will check if the samp02svr process is running, and if it isn't, start it up again. You'll need to install the following crontab:
Код:
*/5 * * * * /path/to/samp/checksamp.sh
checksamp.sh:
Код:
#!/bin/sh
 
PROCESS_COUNT=$(ps -fu root | grep samp02svr | grep -v grep | wc -l)
case $PROCESS_COUNT in
0) /path/to/samp02svr &
;;
1) #OK, program is already running once
;;
*) #OK, program is already multiple times
;;
esac
Make sure that you have to correct paths set up, the script won't work if you haven't. The script is currently unable to handle multiple SA-MP Servers on the same machine, but works perfectly when there is only one running/needed. You need to chmod the checksamp.sh file to 0755 (+x)!
Reply
#3

Thank you for your help and for that I somehow understand. Cheers
Reply
#4

I have 3 server on linux and sometimes they have error on reading the game mode, filterscprts or so bud more as nohup ./samp02Xsvr i dont use and they work perfect
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)