Jump to content
nafeasonto

Anyway to start the 7 Days to Die server as a service?

Recommended Posts

I would liek if I actually have to resart my Windows VM, then the server can start as a service.  Usually BAT files don't play nice with a Windows Service, anyone figure out a way to do it?

Share this post


Link to post
Share on other sites

What's the purpose of having the server run as a service?

 

If the purpose is to make the server start without a user logging in to windows (which doesn't work with "autostart" as this requires a user to log in) you can configure this with Win10 in the task-scheduler. There is an option "run indepentent of user login" (freely translated).

 

If you need it as a service for other reasons, google "runasservice". That allows you to basically run every program as a service. Of course programs that require user interaction will get stuck with that, but the 7d2d server should run fine with this.

Share this post


Link to post
Share on other sites
45 minutes ago, Liesel Weppen said:

What's the purpose of having the server run as a service?

 

If the purpose is to make the server start without a user logging in to windows (which doesn't work with "autostart" as this requires a user to log in) you can configure this with Win10 in the task-scheduler. There is an option "run indepentent of user login" (freely translated).

 

If you need it as a service for other reasons, google "runasservice". That allows you to basically run every program as a service. Of course programs that require user interaction will get stuck with that, but the 7d2d server should run fine with this.

 

I run my dedicated server on a Dell PowerEdge under an ESXI VM, with Windows 2019.  I was just curious if it was even realistic to run it under a service.  I can do an easy work around, for an autologin/shell:startup/then auto lock.

 

I was just curious if the server minds running as a service.  I am well aware how to create a Service under windows, or using NSSM to do things easier. Sorry I didn't make myself clearer in my initial message. 

Edited by nafeasonto (see edit history)

Share this post


Link to post
Share on other sites
18 minutes ago, nafeasonto said:

I was just curious if it was even realistic to run it under a service. 

I see no reason why it should not. But i didn't test it in person.

As said, problems occur usually if the application needs userinteraction or the ui itself is badly involved in it's internal programming, then running it without an ui may cause problems.

Since the server has no user interaction and no user interface (i assume it only outputs text to std::out), there should be no problem.

 

18 minutes ago, nafeasonto said:

I can do an easy work around, for an autologin/shell:startup/then auto lock.

As i said, no need for a workaround, Windows can launch programs without a user logon and without needing them to be run as a service. I'm pretty sure Windows 2019 Server can also do it.

 

Still remaining question: Why? Just theoretical idea with no practice relevance?

Share this post


Link to post
Share on other sites
9 minutes ago, Liesel Weppen said:

I see no reason why it should not. But i didn't test it in person.

As said, problems occur usually if the application needs userinteraction or the ui itself is badly involved in it's internal programming, then running it without an ui may cause problems.

Since the server has no user interaction and no user interface (i assume it only outputs text to std::out), there should be no problem.

 

As i said, no need for a workaround, Windows can launch programs without a user logon and without needing them to be run as a service. I'm pretty sure Windows 2019 Server can also do it.

 

Still remaining question: Why? Just theoretical idea with no practice relevance?

It's easier if I need to restart the server itself, so when windows comes back it auto starts the server. I already found my workaround.  You can administer the server easily through TELNET/Putty.  So the console is really not necessary.  But thanks for the help!

Share this post


Link to post
Share on other sites
4 minutes ago, nafeasonto said:

It's easier if I need to restart the server itself, so when windows comes back it auto starts the server.

Do you even read my posts?

The windows task-scheduler allows you to autostart programs without userlogon and no runasservice-workarounds. It is exactly meant for such use cases.

 

You can also connect to your server via RDP and then just doubleclick the 7d2d-server link previously placed on your desktop... but hmm... that's not really like someone wants a server to run. There are many ways how to remotly access a server. You could have also installed VNC or TeamViewer, or even could probably use Intel AMT to gain low level access remotely. All of them are pretty common usecases for any kind of servers.

 

So basically your question was how to start a 7d2d server on a computer you have no monitor and keyboard attached to?

Share this post


Link to post
Share on other sites
4 minutes ago, Liesel Weppen said:

Do you even read my posts?

The windows task-scheduler allows you to autostart programs without userlogon and no runasservice-workarounds. It is exactly meant for such use cases.

 

You can also connect to your server via RDP and then just doubleclick the 7d2d-server link previously placed on your desktop... but hmm... that's not really like someone wants a server to run. There are many ways how to remotly access a server. You could have also installed VNC or TeamViewer, or even could probably use Intel AMT to gain low level access remotely. All of them are pretty common usecases for any kind of servers.

 

So basically your question was how to start a 7d2d server on a computer you have no monitor and keyboard attached to?

Dude... I am a Network Engineer. I am well aware what RDP is and Windows Task Scheduler.  You aren't understanding what I am saying here.  I am good. 

Edited by nafeasonto (see edit history)

Share this post


Link to post
Share on other sites

Just use Linux. Less memory leaks, and more control via cron.  There is a reason most enterprise servers run Linux.

As a bonus, you even get a nice 10-15% boost in performance.

Share this post


Link to post
Share on other sites
On 10/22/2020 at 8:25 AM, nafeasonto said:

 

I run my dedicated server on a Dell PowerEdge under an ESXI VM, with Windows 2019.  I was just curious if it was even realistic to run it under a service.  I can do an easy work around, for an autologin/shell:startup/then auto lock.

 

I was just curious if the server minds running as a service.  I am well aware how to create a Service under windows, or using NSSM to do things easier. Sorry I didn't make myself clearer in my initial message. 

I see that you’re good, but I am curious...

 

I’m going to ask what I believe you  are asking differently, and see what happens... because I’m betting it does not have windows service API calls built in but I do not know this for a fact.  In my opinion, from what I’ve seen, when you want to control an app that was not designed to run as a windows service (does not support the windows service API) all you’re doing is adding a wrapper that does support the windows service API  on top of the app you want to run that simply sends it special commands or, just a start and a process level kill (eww). NSSM is my personal favorite because of ease of use and all the options is gives you, especially for stopping the app properly, and it can be made to “keep your process up” by auto restarting it as soon as it crashes (more options than task scheduler). 
 

Anyways, the questions!

 

1. On windows, what is the proper/supported way of starting/stopping the game server?

 

2. Does the game support the windows service API?  If so, is there a command or something to run to have it install itself as a service?

 

3. If not answered above, does the game catch/handle signals (Like ctrl-c,ctrl-z, etc) and is one recommended over another to stop the game.

 

4. if the game server does not shut down cleanly (meaning it continues to run after being requested to shut down) are there any other recommended alternatives to shutting it down besides just OS level process termination? Like “remove these files before starting, run these cleanup commands, etc”

 

5. If you have to terminate the game process, are there recommended commands/things to do to clean up or fix knows issues after a hard kill?

 

6. does the game respect windows shutdown/reboot signals? Meaning: if the windows server OS is rebooted/shutdown, does the game receive signals from the OS that it processes to try to properly shut itself down before the OS forces the process to terminate?

 

note:
im Just curious what the answers are., and likely have complicated things, but the answers to these may at least give some idea how well it behaves when you try to wrap it with something like NSSM or task scheduler, scripts, batch files etc. if nothing else, maybe it will anger someone enough to get them to just post a link to whatever scripts/process everyone uses for windows, even if not a service ;) and you can borrow the stuff.

 

 

Edited by doughphunghus (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...