D12-Dev / OpenWorld

A Free Multiplayer Mod For Rimworld
Other
97 stars 17 forks source link

Daemonize Linux server so that it can be autostarted by systemd #32

Closed DW01 closed 1 year ago

DW01 commented 2 years ago

Right now, the Linux server binary run as a discrete TTY line, much like top or vim. This makes it fundamentally incompatible with running in a true daemonized headless mode (where all interaction is handled by external commands hooking into the server), and therefore incompatible with easy autostart via systemd Units on Linux platforms that utilize it.

This is generally a little annoying since if you get a connection abort from your SSH client, restarting the box is the only easy way to get the active TTY back. If the server ran as a daemon with external command hooks or arguments, I could set it up to silently autostart when my VPS does and manage it like I would Apache or nginx.

AlexCloudDev commented 2 years ago

👍🏻 Would really appreciate it

QQLazors commented 1 year ago

@DW01 As a workaround for dealing with connection aborts, you can launch the server in a terminal multiplexer, like "screen" and detach from it and it will run in the background. That way if your session loses connection it won't stop. No issues so far that I've seen.

Super late to the party I know, but hopefully it might help.

JanuszSamborski commented 1 year ago

You can run it in docker container.

HolyHustler commented 1 year ago

You can also use the pm2 process manager, I never had problems with it.