• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Restarter

Luiiso

New Member
Joined
Jul 6, 2008
Messages
43
Reaction score
1
Hello i would like to know how i can make a restarter for my ot??
 
Where would you execute this command?
In the console?

Sorry. xD
Yes, open a terminal and copy paste that in. Make sure you are in the forgottenserver directory.

The ./tfs means execute this file (tfs) the dot (. ) in front of the / is to tell the server this directory. If you leave out the dot then the server will think you mean the root directory.
 
Where would you execute this command?
In the console?

Sorry. xD

Mhmm, I never thought I'd be helping you any day, haha.

create a file with:
Code:
touch restarter.sh

use a text editor of your choice (I like vim), paste the code inside this file and save it:
Code:
while true; do ./tfs; done;

make the code executable with:
Code:
chmod +x restarter.sh

run the script:
Code:
./restarter.sh

Hit me up if you need more help.

Just make sure to close the restart.sh before closing tfs otherwise it will loop through and re-start the server.

Kindest Regards,
Okke
 
You can also add this line just before the loop:
Code:
ulimit -c unlimited
It will enable core dumps, so when your application crashes, core dump file will be created, which can be later opened in gdb to find information about the reason of the crash.

To avoid overriding core dump file in the situation when two crashes happens in a short period of time, you can modify core_pattern, for example:
Code:
echo "/tmp/cores/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
More details: The Core Pattern (core_pattern), or how to specify filename and path for core dumps
 
or you can create an archive called "restarter.sh" and put this code inside:

Code:
#!/bin/bash
ulimit -c unlimited
while true; do ./tfs --log-file "output.txt" "error.txt"; done

then before starting your server write this command on screen (open a screen before ofc): ./restarter.sh

Ps. maybe need a especial permission before, so write chmod 777 restarter.sh
 
or you can create an archive called "restarter.sh" and put this code inside:

Code:
#!/bin/bash
ulimit -c unlimited
while true; do ./tfs --log-file "output.txt" "error.txt"; done

then before starting your server write this command on screen (open a screen before ofc): ./restarter.sh

Ps. maybe need a especial permission before, so write chmod 777 restarter.sh
I cant run that on Ubuntu 20.04
 
Still, you haven't mentioned any errors, the solution won't be helpful if we don't know what the problem was, anyways, I'm happy you figured out yourself.
 
Back
Top