Linux nohup problems
#1

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?
Reply
#2

chmod +x restart.sh
Reply
#3

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:
Reply
#4

Can you run this?

./samp03svr &
Reply
#5

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

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

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

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

Same error: No such file or directory
O_o
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)