03.01.2012, 19:02
(
Последний раз редактировалось Deal-or-die; 04.01.2012 в 02:56.
Причина: Added Edit, and Forgot to bold a word :P
)
Hey Everyone.
I am trying to get my server to auto boot using Method 2 from the sa-mp wiki (Click here) But i am unsure if the paths specified in the restart.sh is from root or the username that sa-mp server is installed onto.
Example
Would it be
samp="/home/username/samp03/samp03svr" (root)
or
samp="/samp03/samp03svr" (Username)
Same For
cd /path/to/samp/server
I am doing this logged in from the user account and not root
I am placing the restart.sh into /samp03/ folder
I am running CentOS 5.5
----Edit----
And Since
nohup ./restart.sh &
was giving me the same errors as 'Geso' was getting. (Here)
So i am using the command 'chmod +x restart.sh' in replacement of nohup ./restart.sh &
Cheers for any assistance
I am trying to get my server to auto boot using Method 2 from the sa-mp wiki (Click here) But i am unsure if the paths specified in the restart.sh is from root or the username that sa-mp server is installed onto.
Код:
Method 2 If you don't want to use crontab and if you want to have server log saved to a separate directory on server crash you can use this script. To keep your server online using this script, first you need to stop your server and then execute it with this command: nohup ./restart.sh & restart.sh:This method will bring your server back up whenever it crashes or when the RCON exit command is issued. It will also save the server log into a separate directory.Код:#!/bin/sh log=samp.log dat=`date` samp="/path/to/samp/server/samp03svr" cd /path/to/samp/server echo "${dat} watchdog script starting." >>${log} while true; do echo "${dat} Server exited, restarting..." >>${log} mv /path/to/samp/server/server_log.txt /path/to/samp/server/logs/server_log.`date '+%m%d%y%H%M%S'` ${samp} >> $log sleep 2 done
Would it be
samp="/home/username/samp03/samp03svr" (root)
or
samp="/samp03/samp03svr" (Username)
Same For
cd /path/to/samp/server
I am doing this logged in from the user account and not root
I am placing the restart.sh into /samp03/ folder
I am running CentOS 5.5
----Edit----
And Since
nohup ./restart.sh &
was giving me the same errors as 'Geso' was getting. (Here)
Код:
[1] 1771 [root@vps***** samp03]# nohup: appending output to `nohup.out' nohup: cannot run command `./restart.sh': Permission denied
Cheers for any assistance