Absolutely. I can understand implementing this feature for some special cases, like containers that should clear all hint of a user away on log off. It should never have been the default, and breaks an entire category of software. In my standard .bashrc file, I have the following snippet to warn me if I am on a system with that stupid setting enabled.
if which loginctl > /dev/null && loginctl >& /dev/null; then
if loginctl show-user | grep KillUserProcesses | grep -q yes; then
echo "systemd is set to kill user processes on logoff"
echo "This will break screen, tmux, emacs --daemon, nohup, etc"
echo "Tell the sysadmin to set KillUserProcesses=no in /etc/systemd/login.conf"
fi
fi
Thanks, now I know why Emacs daemon keeps delaying my restarts in the system (just discovered that NixOS defaults KillUserProcesses to false).
Turning this on to true, for me it does no make sense to a user service (yeah, I run emacs as a user's systemd service) to keep running after I logout of my system.
P.S.: And the fact that for some people this behavior makes sense is why I think Lenart decision to put this as an option makes sense.
I'm glad that it helped resolve your issue, though I still don't think it was an appropriate choice for a default. I tend to do most of my work on a remote server, using tmux and emacs daemon to pick up right where I left off in the case of a dropped connection. That systemd would terminate my process when I explicitly requested it not to be is very abnormal.
You haven't requested systemd, you started a user scope, and haven't started a service for what you need.
POSIX is nice, but rather lacking in certain aspects, such as security anf administration-friendliness. cgroups help with both, but people have to understand them and use them well.
Handling and ignoring SIGHUP is the explicit way to indicate that a program should not be terminated. That systemd invented a new category and then ex post facto declared that everybody else was wrong for not using it is ridiculous. Systemd changing behavior such that I must "Simon says nohup" is completely asinine.