Score:0

How to keep processes running after ending ssh session when systemd kills processes after user logs out?

in flag

I've tried many highly voted answers on stack exchange suggesting nohup, disown, command &, and (command &) and they did not work for me on Ubuntu server 20.04. I found this answer why they don't work since 2016, due to a systemd default change in how it treats user processes after user logout - Details

There seems to be way with systemd (the elephant in the room) - see this answer here But that requires creating systemd services and managing through systemctl, etc.

Is there a way to configure systemd to change the behavior?

I've found this answer for Oracle Linux: Configure Systemd to Enable User Processes to Continue to Run After Logout

Will this work with Ubuntu? I could see problems if many users create many processes and do not manage them. This is for a system with only a few users and few processes.

Terrance avatar
id flag
Looking at the link you posted about configuring systemd to enable the processes to continue, I cannot see any reason why it would not work. All files required are there in Ubuntu 20.04. Unfortunately, I don't have Ubuntu Server installed on any of my systems so I cannot verify for the Server part, but I would assume that it is not much different as far as systemd goes.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.