Tuesday, 31 May 2016 09:36

Systemd change has Linux users up in arms


A change in the most recent version of systemd, the init system that has been recently adopted by many GNU/Linux distributions, has users up in arms.

The change, announced a few days ago, kills background processes by default when a user logs out, the opposite of the behaviour that was exhibited earlier.

This would cause problems for users, for example, of terminal multiplexers like screen and tmux as they would be unable to return to a process once they have logged out.

If a server admin had a bunch of scripts that logged into a server, then started a process using screen and logged out, the process would be killed. This is a fairly common thing that many admins do.

In another scenario, if a user logs in to another machine, and starts a process, they cannot background the process and then logout and expect it to keep running. The user would have to keep the original session running.

Justifying the change, the main systemd developer, Red Hat's Lennart Poettering, said on a mailing list run by the community distribution, Fedora: "In my view it was actually quite strange of UNIX that it by default let arbitrary user code stay around unrestricted after logout.

"It has been discussed for ages now among many OS people, that this should (be) possible but certainly not be the default, but nobody dared so far to flip the switch to turn it from a default to an option.

"Not cleaning up user sessions after logout is not only ugly and somewhat hackish but also a security problem. systemd 230 now finally flipped the switch and finally by default cleans everything up correctly when the user logs out.

"But we do so in a very conservative way actually: a) there's a compile time switch to turn this off globally (--without-kill-user-processes, not used in Fedora) b) there's a runtime switch to turn this off locally on the system (in logind.conf) c) there's a way to opt-out individually for each user and each task from the cleanup logic, via systemd-run/loginctl linger.

"This operation goes through PK, and thus can be configured in a more strict or more open policy, depending on what the admin prefers. I am pretty sure we should consider it our duty as Fedora developers to improve the Linux platform, and I am pretty sure that properly cleaning up processes on logout is a step towards that, not against it."

Users, however, seem to be far from convinced. On the Debian bug tracking list, Guus Sliepen wrote: "Now you can no longer expect a long running background processes to
continue after logging out. I believe this breaks the expectations of many users. For example, you can no longer start a screen or tmux session, log out, and expect to come back to it.

"For this reason, I think it is a bad decision on the part of the systemd maintainers to enable this feature by default, and it should rather be disabled by default in Debian, either by compiling systemd with --without-kill-user-processes or by setting KillUserProcesses=no in /etc/systemd/logind.conf."

Asked for comment, senior Debian developer Russell Coker said he was supportive of the change.

"I think that this debate is rather silly," he said, referring to the discussion on the Debian bug tracking system. "Systemd has a new configuration option, it can be disabled at compile time but there's an option for configuring it at run-time by a file in /etc. Whenever there is such an option Debian always goes for run-time configuration.

"So the question is what the default configuration should be. There is also apparently a command to ask systemd to launch a process that won't be killed on logout, so even on a system that is configured to kill processes on logout it is possible to run long-lived processes.

Russell said that for desktop systems he believed the best default would be to kill all processes on logout. "That prevents stray processes from interfering with the correct operation of the system and means that people like my parents won't reboot their systems; when they have problems they can just logout and login again.

He said for servers the best default was to not kill processes so screen, tmux, and nohup worked as desired. "Note that screen, tmux, and nohup are regarded as expert tools by today's standards and many people with root access nowadays don't have the skill to use them.

"The people who have the skill to use screen, tmux, and nohup have the skill to change the systemd configuration or use a special systemd command for spawning processes that aren't killed on logout. The typical desktop users don't have the skill to do either.

"Therefore it makes sense to me to have the default be the option that works best for desktop users. But if the Debian developers responsible for this decision choose to make the default configuration not kill processes on logout, it will be easy for me to change the configuration of my parents' system."

Russell said he would backport this version of systemd to Jessie, the current stable version of Debian, if no-one else did it first. "This is a feature that I really want on some of my systems," he said.


26-27 February 2020 | Hilton Brisbane

Connecting the region’s leading data analytics professionals to drive and inspire your future strategy

Leading the data analytics division has never been easy, but now the challenge is on to remain ahead of the competition and reap the massive rewards as a strategic executive.

Do you want to leverage data governance as an enabler?Are you working at driving AI/ML implementation?

Want to stay abreast of data privacy and AI ethics requirements? Are you working hard to push predictive analytics to the limits?

With so much to keep on top of in such a rapidly changing technology space, collaboration is key to success. You don't need to struggle alone, network and share your struggles as well as your tips for success at CDAO Brisbane.

Discover how your peers have tackled the very same issues you face daily. Network with over 140 of your peers and hear from the leading professionals in your industry. Leverage this community of data and analytics enthusiasts to advance your strategy to the next level.

Download the Agenda to find out more


Sam Varghese

website statistics

Sam Varghese has been writing for iTWire since 2006, a year after the site came into existence. For nearly a decade thereafter, he wrote mostly about free and open source software, based on his own use of this genre of software. Since May 2016, he has been writing across many areas of technology. He has been a journalist for nearly 40 years in India (Indian Express and Deccan Herald), the UAE (Khaleej Times) and Australia (Daily Commercial News (now defunct) and The Age). His personal blog is titled Irregular Expression.



Recent Comments