Search found 5 matches
- Thu Jun 07, 2018 12:25 am
- Forum: Dedicated servers and Virtual Dedicated Servers
- Topic: Running .sh script at boot
- Replies: 9
- Views: 3977
Re: Running .sh script at boot
By responds as dead, I mean the screen session is marked as dead under screen -ls, and I have to screen -wipe and then start the server again.
- Wed Jun 06, 2018 2:31 pm
- Forum: Dedicated servers and Virtual Dedicated Servers
- Topic: Running .sh script at boot
- Replies: 9
- Views: 3977
Re: Running .sh script at boot
So, adding the interpreter makes it run, however the screen session responds as dead each time.
- Wed Jun 06, 2018 2:27 pm
- Forum: Dedicated servers and Virtual Dedicated Servers
- Topic: Running .sh script at boot
- Replies: 9
- Views: 3977
Re: Running .sh script at boot
Yeah, running it by hand works exactly how I want. I'll post results from using the command interpreter.
- Wed Jun 06, 2018 10:13 am
- Forum: Dedicated servers and Virtual Dedicated Servers
- Topic: Running .sh script at boot
- Replies: 9
- Views: 3977
Re: Running .sh script at boot
No problem.
Crontab:
@reboot /server/autorun.sh
autorun.sh
if ! screen -list | grep -q "hl2rp"; then
echo "Screen session not found. Starting server."
bash /server/server.sh
else
echo "Screen session found. Waiting for next check."
fi
/server/server.sh
#!/bin/sh
echo "Starting ...
Crontab:
@reboot /server/autorun.sh
autorun.sh
if ! screen -list | grep -q "hl2rp"; then
echo "Screen session not found. Starting server."
bash /server/server.sh
else
echo "Screen session found. Waiting for next check."
fi
/server/server.sh
#!/bin/sh
echo "Starting ...
- Wed Jun 06, 2018 8:46 am
- Forum: Dedicated servers and Virtual Dedicated Servers
- Topic: Running .sh script at boot
- Replies: 9
- Views: 3977
Running .sh script at boot
Hi there
So, I've been having some trouble getting my Ubuntu 18.04 x64 VDS to run a server startup script at boot. Crontab for some reason doesn't work (and throws no errors either), using /etc/init.d and systemd also refuse to work and throw no errors. The script works exactly the way it should ...
So, I've been having some trouble getting my Ubuntu 18.04 x64 VDS to run a server startup script at boot. Crontab for some reason doesn't work (and throws no errors either), using /etc/init.d and systemd also refuse to work and throw no errors. The script works exactly the way it should ...