Zandronum Autolaunching Server?

General help and assistance forum.
Post Reply
fignewts
Registered just to make one post
Posts: 1
Joined: Fri Mar 23, 2018 12:55 am

Zandronum Autolaunching Server?

#1

Post by fignewts » Tue Mar 27, 2018 3:55 am

Hello all,

I tried searching through the forums to see if this was posted already, but I couldn't find anything on it. I am recently hosting a server and wanted to know if there is anyway to relaunch my server without my input. For example if it happens to crash and I'm sleeping, I wouldn't be able to launch it again until I wake. I have tried autolaunching programs such as Restarted and CRP. They work well, however they only launch executable files. Which means it just starts plain Doom II, instead of the batch file I have made for my server. I can't seem to find anything on the internet about relaunching batch files after crashing. And CRP, Restarted, etc. don't launch batch files, only executables. Is this even possible? Thanks for any help guys.

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

Re: Zandronum Autolaunching Server?

#2

Post by Empyre » Tue Mar 27, 2018 5:26 pm

Have your batch file relaunch itself. The start /WAIT command will wait to do the next command until the program being started has closef.

Code: Select all

@echo off
echo Launching Server...
:square1
c:
cd \<path to server's folder>
start /WAIT <command line for server>
echo ReLaunching Server...
goto square1
"For the world is hollow, and I have touched the sky."

User avatar
BlushBerry
 
Posts: 90
Joined: Tue Apr 26, 2016 11:12 pm
Location: root
Clan: Nuclear Empire
Clan Tag: [NE]
Contact:

Re: Zandronum Autolaunching Server?

#3

Post by BlushBerry » Sat Apr 14, 2018 4:40 am

If you're using linux to host your server you can always look into systemd to manage your server as a service.

An example of a service to automatically restart your server after a crash is as follows.

Code: Select all

[Unit]
Description=Nuclear Empire D4T Zandronum Server
Wants=network-online.target
After=network.target network-online.target

[Service]
WorkingDirectory=/home/zandronum/zandronum/
ExecStart=/home/zandronum/zandronum/ned4t.sh
Restart=always
User=zandronum

[Install]
WantedBy=multi-user.target
This is an example of how we run our Nuclear Empire Death Foretold Server.

Here is the arch wiki entry on systemd I don't know if you are using linux or not but regardless of what distro you may or may not be using this is still relevant.
https://wiki.archlinux.org/index.php/systemd

Post Reply