Permissions Denied for AutoBoot Method 2
#1

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.

Код:
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:

Код:
#!/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
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.
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)
Код:
[1] 1771
[root@vps***** samp03]# nohup: appending output to `nohup.out'
nohup: cannot run command `./restart.sh': Permission denied
So i am using the command 'chmod +x restart.sh' in replacement of nohup ./restart.sh &

Cheers for any assistance
Reply


Messages In This Thread
[Fixed]Permissions Denied for AutoBoot Method 2 - by Deal-or-die - 03.01.2012, 19:02
Re: Permissions Denied for AutoBoot Method 2 - by Riddy - 03.01.2012, 19:41
Re: Permissions Denied for AutoBoot Method 2 - by robintjeh - 03.01.2012, 20:34
Re: Permissions Denied for AutoBoot Method 2 - by Deal-or-die - 03.01.2012, 20:53
Re: Permissions Denied for AutoBoot Method 2 - by Riddy - 03.01.2012, 20:57
Re: Permissions Denied for AutoBoot Method 2 - by Deal-or-die - 03.01.2012, 21:05
Re: Permissions Denied for AutoBoot Method 2 - by Deal-or-die - 03.01.2012, 21:21
Re: Permissions Denied for AutoBoot Method 2 - by Riddy - 03.01.2012, 21:23
Re: Permissions Denied for AutoBoot Method 2 - by Deal-or-die - 03.01.2012, 21:58
Re: Permissions Denied for AutoBoot Method 2 - by Deal-or-die - 04.01.2012, 02:56

Forum Jump:


Users browsing this thread: 1 Guest(s)