On Thu, Nov 18, 2021 at 09:21:34PM +0000, Jonathan Dowland wrote: > On Thu, Nov 18, 2021 at 03:46:48PM -0500, Greg Wooledge wrote: > > (I still wonder whether systemd offers anything relevant here. And if > > not, what the hell *is* the point of systemctl --user? I've never used > > it, nor found any reason to use it. Yet.) > > systemd certainly does offer something here. It's related to what > processes are considered to belong to a "session", it came in with > version 230, and there was quite a stink about it from people who > wanted this not to happen, at the time: > <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825394> > > It seems that the Debian Xsession setup does start a systemd --user > service. I've never tried to use it for this purpose.
I've seen that bug before. That's a change which got reverted, or at least, the default behavior was returned to the previous norm. Debian's /etc/systemd/logind.conf has #KillUserProcesses=no which indicates that the default is for this "kill everything the user left running" setting to be disabled, as it was before the controversial change. I think this is a dead end for this particular question, because it's an all-or-nothing setting. Either *all* background processes that the user creates get nuked when the user logs out, or *none* of them do. There doesn't appear to be a way to "mark" particular processes for reaping while leaving the rest alone. Maybe some other part of systemd offers more flexibility, but if so, I don't know what part it would be. I'm still waiting to see an actual user-friendly *document* that describes how to use systemd.