-1

I am running a game server as a service using systemctl to start and stop a script that runs the whole thing. I tried to modify the script to let me use a screen so I could attach to the process that the server is being run on, and issue commands. But so far I've not had much luck. Is it possible to attach to services that are running on a server?

2 Answers2

0

Not in systemd, but you can start the service using

screen -D -m yourservice

which will create a detached screen session that will wait for the process to exit (so systemd does not see the service terminating immediately if you use this in an ExecStart line). You can then attach to that session normally.

Simon Richter
  • 28,572
  • 1
  • 42
  • 64
0

This question belongs on the Unix/Linux StackExchange.

See e.g: https://unix.stackexchange.com/questions/453998/systemd-connect-to-stdin-stdout-after-service-has-started

If you want to solve it via programming, you could consider writing a small web application as the interface instead of the console.

GeertPt
  • 16,398
  • 2
  • 37
  • 61