Nee help with CentOS.
#1

I want to install a script that auto restarts my server if it goes offline.

I tride using https://sampwiki.blast.hk/wiki/Linux_Server#Method_2

But Something seems to be going wrong. I keep getting this error when i use nohup ./restart.sh &
Quote:

nohup: ignoring input and appending output to `nohup.out'
nohup: failed to run command `./restart.sh': No such file or directory

My restart.sh is as follows:
Quote:

#!/bin/sh
log=samp.log
dat=`date`
samp="/root/samp03"
cd /root/samp03

echo "${dat} watchdog script starting." >>${log}
while true; do
echo "${dat} Server exited, restarting..." >>${log}
mv /root/samp03/server_log.txt /root/samp03/logs/server_log.`date '+%m%d%y%H%M%S'`
${samp} >> $log
sleep 2
done

My SAMP Directory on my VPS:



NOTES: I have the correct permissions set, the paths look alright, and yes i can start my server using ./samp03svr &

Any/all help would be GREATLY appreciated!
Reply
#2

It could be your gamemode/ or any other filterscript causing it, tried using on a different gamemode?
Reply
#3

no you dont understand what im having issues with, https://sampwiki.blast.hk/wiki/Linux_Server#Method_2 when i use method#2 i get the error:
Quote:

nohup: ignoring input and appending output to `nohup.out'
nohup: failed to run command `./restart.sh': No such file or directory

Nothing to do with GM or FS :P
Reply
#4

Umm... You need to be in the same directory where restart.sh is, or else you will get that warning.

PS: Try changing restart.sh to this:

Код:
#!/bin/sh
log=samp.log
dat=`date`
samp="/root/samp03/samp03svr"
cd /root/samp03

echo "${dat} watchdog script starting." >>${log}
while true; do
echo "${dat} Server exited, restarting..." >>${log}
mv /root/samp03/server_log.txt /root/samp03/logs/server_log.`date '+%m%d%y%H%M%S'`
${samp} >> $log
sleep 2
done
Reply
#5

I changed the code and im still getting same error. I am in the correct dirrectory:
Reply
#6

Post your nohup.out log here.
Reply
#7

Type "./restart.sh" and paste what it says here. If it can't find that, type "ls" and "pwd", also pasting the output here.
Reply
#8

Try ./samp03svr &
Reply
#9

Mate ..
Its better to do this.

Chmod +x samp03svr announce
nohup ./samp03svr

I dont think that this is better to make ./restart.sh

Use this

Chmod +x samp03svr announce
nohup ./samp03svr
Reply
#10

Quote:
Originally Posted by linuxthefish
Посмотреть сообщение
Type "./restart.sh" and paste what it says here. If it can't find that, type "ls" and "pwd", also pasting the output here.
It says:

Quote:

[root@samp samp03]# ./restart.sh
-bash: ./restart.sh: /bin/sh^M: bad interpreter: No such file or directory

and ls

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)