SA-MP Forums Archive
Linux nohup problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Linux nohup problems (/showthread.php?tid=453389)



Linux nohup problems - thimo - 24.07.2013

Okay so im trying to use an auto restarter. The script is called restart.sh but when i write:
Код:
nohup ./restart.sh &
It gives this error:
Код:
nohup: failed to run command `./restart.sh': Permission denied
now when i try to use
Код:
nohup ./samp03svr.shp
it works fine... Why doesnt it work?


Re: Linux nohup problems - Djole1337 - 24.07.2013

chmod +x restart.sh


Re: Linux nohup problems - thimo - 24.07.2013

Now it says no such file or directory wtf...
Код:
[root@server1 samp03]# nohup ./restart.sh &
[1] 9770
[root@server1 samp03]# nohup: ignoring input and appending output to `nohup.out'
nohup: failed to run command `./restart.sh': No such file or directory
Picture of it being there:



Re: Linux nohup problems - ColorHost-Kevin - 24.07.2013

Can you run this?

./samp03svr &


Re: Linux nohup problems - thimo - 24.07.2013

Код:
[root@server1 samp03]# nohup ./samp03svr &
[1] 9776
[root@server1 samp03]# nohup: ignoring input and appending output to `nohup.out'
That works fine


Re: Linux nohup problems - ColorHost-Kevin - 24.07.2013

So your server is online with this command fine? Great!


Re: Linux nohup problems - thimo - 24.07.2013

Yes but the restart.sh is supposed to restart it when the server crashes. I want to get that working D:


Re: Linux nohup problems - Mark™ - 24.07.2013

Try nohup restart.sh & without "./" and report back if you're successful.


Re: Linux nohup problems - thimo - 24.07.2013

Same error: No such file or directory
O_o


Re: Linux nohup problems - thimo - 25.07.2013

I got this now:
Код:
#!/bin/bash
export GTA_PATH=/root/samp03
cd $GTA_PATH
while [ true ]; do
cat {$GTA_PATH}/server_log.txt >> {$GTA_PATH}/full_server_log.txt
rm {$GTA_PATH}/server_log.txt
touch {$GTA_PATH}/server_log.txt
./samp03svr
done
I think its the right path but im not sure... In the picture i showed earlier it shows up like that