Keeping server processes running while not connected

I want my server to keep the processes running while I am not connected. I tried using screen when I SSH into the server but when I closed my laptop lid and then come back to the previous screen session it comes up with the error Write Failed: broken pipe.

Does anyone know any other way of keeping server processes running without being constantly connected to it?

Are you running screen on your VM or on your local machine? If you’re running screen locally, your network connection is probably dropping when you sleep your laptop, which causes the disconnection.

As implied by mattbull, screen wants running on the remote server to keep the processes running there (i.e. ssh in first and then type screen)

Personally I’d use tmux, which is a great alternative to screen (though I don’t think it’s installed on the GVL image by default so need to run sudo apt-get install tmux or similar) – lots of tutorials out there on the web.

With either of them one needs to ssh back in, if the connection is dropped by closing and reopening the laptop, and then reattach the session to see what it’s now doing. For tmux, having logged in with ssh, that could be simply typing ‘tmux attach’ and you’re back where you were.

1 Like

Thanks for the information.

Yes I am screening from local machine. Next time I will use screen in the server and then hopefully when my computer get disconnected the process will not stop.

1 Like

This topic was automatically closed after 7 days. New replies are no longer allowed.