What about a Windows Service #537
Replies: 3 comments
-
100% agree. I use NSSM ( https://nssm.cc ) to run all my game servers as services: Except Space Engineers, so when my server reboots, all my game servers come up automatically, except that I have to login and start torch to start Space engineers. What I'd LOVE to be able to do would be to install/setup/configure my SE server via torch, use torch like normal to make sure everything is working, and then when the entire config is working and I'm happy with it, I could shut it down and then from a command line, do something like: Torch.Server.exe -NoConsole -World -AnyOtherArgumentsToMakeItWorkAndRunAutomatically And when doing this, it wouldn't launch the whole console or anything, it would just run the game server with the specified config, log things, as usual, etc, but in general, would just allow you to run the game from the command prompt with no console, and then you could use this command in something like NSSM (or SrvAny or whatever service wrapper utilitiy you want) to run it as a service. I tried setting it up using NSSM, since when I have Torch configured to start my server automatically when it runs, it just works without any other interaction, I thought it might work, but it erros out and the service pauses... Not sure why. Anyway, a command line option or config file option to run it headless, so it could be run as a service would be nice. (Or maybe I'm doing something wrong/missing an option... My other servers work fine with NSSM, but can't seem to get torch server to do it without error.) |
Beta Was this translation helpful? Give feedback.
-
P.S. I've tried with and without I/O redirection in NSSM and I've also tried "allowing service to interact with the desktop," running a .bat file from NSSM to start Torch.Server.exe, enabling/disabling the NOGUI options in the torch.cfg file, running as system, as well as my usual game server service (non-admin) account, but no luck. The only clue I have as to why is this error in either STDIO or STDERR: |
Beta Was this translation helpful? Give feedback.
-
Well, I found something that's not optimal (in my opinion), but good enough. I used NSSM to create the service entry, and with the torch.cfg file set to have noGUI, I edited the Services that NSSM created, changing the "ImagePath" entry (which usually reads "c:<path>\nssm.exe") to point to Torch.Server.exe, like so: The service start properly, auto-save still happen, and the server runs fine. If/when I stop the service, it takes a little bit and eventually gives the error that the process terminated abnormally, but it does its auto-save and seems to exit fine and starts up again correct. I'll run this way for a while and see how it goes, as it looks good enough for now, so far. :-) |
Beta Was this translation helpful? Give feedback.
-
I saw some Youtube videos about Torch and have done some reading as well as perusing the Wiki. I think it would be a great enhancement to wrap it in a Windows Service so that it could be run on a server without having to login to the Windows Server.
Beta Was this translation helpful? Give feedback.
All reactions