OpenWorld icon indicating copy to clipboard operation
OpenWorld copied to clipboard

Daemonize Linux server so that it can be autostarted by systemd

Open DW01 opened this issue 2 years ago • 3 comments

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.

DW01 avatar May 30 '22 20:05 DW01

👍🏻 Would really appreciate it

AlexCloudDev avatar Jun 02 '22 15:06 AlexCloudDev

@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.

QQLazors avatar Sep 14 '22 04:09 QQLazors

You can run it in docker container.

JanuszSamborski avatar Oct 21 '22 23:10 JanuszSamborski

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

HolyHustler avatar Oct 23 '22 09:10 HolyHustler