Systemd Starts Killing Your Background Processes By Default (blog.fefe.de) 924
New submitter nautsch writes: systemd changed a default value in logind.conf to "yes", which will kill all your processes, when you log out... There is already a bug-report over at debian: Debian bug tracker.
The new change means "user sessions will be properly cleaned up after," according to the changelog, "but additional steps are necessary to allow intentionally long-running processes to survive logout. To effectively allow users to run long-term tasks even if they are logged out, lingering must be enabled for them."
The new change means "user sessions will be properly cleaned up after," according to the changelog, "but additional steps are necessary to allow intentionally long-running processes to survive logout. To effectively allow users to run long-term tasks even if they are logged out, lingering must be enabled for them."
security best practice? (Score:4, Insightful)
In my mind if you want background processes to stay alive, you should explicitly state so, and not have the system make the assumption, even if it has been the convention that background processes do stay alive. To me it just seems a potential vector for a backdoor or something, I dunno >
Re:security best practice? (Score:5, Informative)
you should explicitly state so
nohup
Re:security best practice? (Score:4, Insightful)
Not sure why the GP was marked as troll, it stated the problem very clearly, and the parent of this, nohup response is a very good, perhaps best response. You should NOT leave user processes active post logout unless they are specifically declared as such, and even then there is room for argument that allowing a USER , not admin level process to run in absence of the user is bad practice.
Re:security best practice? (Score:5, Insightful)
Not sure why the GP was marked as troll, it stated the problem very clearly, and the parent of this, nohup response is a very good, perhaps best response. You should NOT leave user processes active post logout unless they are specifically declared as such,
Here's the problem with your idea. These processes are already killed when you log out if you haven't done something to detach them from their PPID. That's already the default. Now the problem is that systemd will kill even processes you have done that to, unless you reconfigure systemd. That is not arduous, but changing the default behavior should not be the default. I am Jack's total lack of surprise that the systemd developers would change default behavior, since that's what they have been up to all along. I am also unsurprised that many slashdotters who lack perspective are willing to share their utterly worthless opinions with the rest of us. It's not that these guys are trying to make improvements that rankles. It's the slipshod quality of their efforts, and their arrogant insistence that they know better than the giants of computing history that figured this stuff out to begin with. They put together an extremely compelling system that we are still using, knocking off, and reinventing decades later, and these systemd tools are sure that they were a bunch of morons.
Re:security best practice? (Score:5, Interesting)
Re:security best practice? (Score:5, Insightful)
Re:security best practice? (Score:5, Insightful)
Not sure why the GP was marked as troll, it stated the problem very clearly, and the parent of this, nohup response is a very good, perhaps best response.
Exactly.
You should NOT leave user processes active post logout unless they are specifically declared as such,
the ampersand *is* the specific declaration that you want the process to be active post logout, otherwise it does not survive the termination of the login session.
and even then there is room for argument that allowing a USER , not admin level process to run in absence of the user is bad practice.
Not at all. I have processes to run that are processing information when I leave to go home and I want to check it the next day when it has finished. If I did not have that option then my user session would have to remain logged in and that *is* recognized as bad security practice.
Re:security best practice? (Score:4)
nohup, screen etc. have always persisted beyond the end of a session and this has been expected behaviour for the past thirty years or so. Anything that changes that is a bug and needs to be fixed. Default behaviour already cleans up on logout if processes aren't detached from their parent process so this shouldn't be a problem.
Fucking up expected and long-standing behaviour because Gnome can't clean up after itself, and where this is the 'fix', is total nonsense. God knows what other behaviour this will fuck up.
Re: (Score:3)
Re: (Score:3)
Re:security best practice? (Score:5, Informative)
How about doing anything that takes a long time and you don't want to remain logged in for it to complete? For example you are running a standard program that is going to take hours or even days to process some data, so you redirect stdin to /dev/null, stdout to one file, stderr to either the same file or another file, and you start the whole thing with the nohup shell command.
There is already a well established mechanism for cleaning up background processes, i.e. the SIGHUP signal. And there is already a mechanism for explicitly stating that you don't want a process to die when you log out, and that is the shell's "nohup" command (which blocks the hangup signal that is sent to the process when the user exits).
And in what way does this new mechanism "enhance security"? Running something in the background after you log out doesn't give you any more privileges than if you remained logged in.
Why do the systemd folks think they need to keep reinventing the wheel? This feels like a solution in search of a problem.
Re:security best practice? (Score:5, Insightful)
Systemd developers then say that tmux, screen, nohup, etc are all broken
This is the phenomenon that pisses me off the most. They know these well-known applications exist, and precisely how they work and how *nix systems conventions work, and then have the gall to say that *everyone* else has a 'bug' because systemd decided to throw all that out. They don't say that it would be ideal if these other applications would add features, they say 'oh, they are buggy' to make users go away. It's an insane amount of hubris.
It's still hungry... (Score:4, Funny)
Just fix the docs... (Score:5, Funny)
FTFY.
systemd: Repeating past mistakes since 2010 (Score:4, Insightful)
Yay! Awesome!
systemd is by far the stupidest thing to happen to Linux, ever... It's not that different from Java. "Oh, new clean shiny thing that is lean and mean!" Then they halfheartedly learn what the real world requires and half-ass it ever since.
WTF (Score:5, Interesting)
So, "screen" has always been a good way to ensure that processes don't get killed randomly by disconnections, logout or X crashes.
Then comes systemd and kills all your processes at logout, even when launched with screen.
Finally, then comes Poettering, explaining you that you're a moron if you expect to keep those processes running.
Seriously, the systemd devs make it really hard no to hate them.
Re:WTF (Score:5, Insightful)
Poettering said nothing of the sort, you just assumed he did as kind of reflexive ad-hominem. systemd seems to be a common trigger word on Slashdot these days.
The problem here is that the mechanism supplied for handling this situation is inadequate. It requires running screen via a special invocation, or modifying screen to be aware of systemd APIs. So Poettering isn't calling anyone a moron for wanting this functionality, he is offering an API for it. It's just that the API is not good enough, which does bring the systemd developer's competence into question.
There is plenty to be bothered by here, but there is no need to drag it down to that level.
Re:WTF (Score:4, Interesting)
It requires running screen via a special invocation, or modifying screen to be aware of systemd APIs.
WTF should screen care about systemd?
Seriously....
Re:WTF (Score:5, Insightful)
Bad point of view. It shouldn't be systemd's task to decide who is running properly and who is not. If a process lingers because of some bad behavior or bug, than that should be corrected, but assuming every process is an idiot and should be killed is very stupid. The default behavior should be - as it always was - that if a process is running after the user left, does so intentionally. Such decades old expected behavior should not be changed because of some idiot thinks everyone's usage patterns fits his own.
I was lucky to read about this before I updated to this new systemd version (which I didn't), but we can't assume everyone will read about it, they're in for a real treat.
Re:WTF (Score:5, Informative)
That already happens. The user shell knows that the user has disconnected via HUP signal, and then passes that signal along to the spawned child processes. If the user ran a process with & or nohup, then the shell knows not to mess with those processes. That is, until systemd comes along, breaks more convention, and just terminates everything anyway, ignoring what the user already told the system. Unless the user specifically interacts in such a way that only works on certain systemd supported operating system variants, running certain versions of systemd, configured in certain specific ways.
The previous and well understood behavior already did this, and it worked on all UNIX-like systems. The new systemd way works on a very small minority of systems, and requires special behavior and a half-dozen special checks to detect environment.
This is not an improvement. This is single-user proprietary behavior.
Re: (Score:3)
Really? No other way? So screen working for all these decades has been happy coincidence?
Re: (Score:3)
In the same vein I didn't fuck your mother - yet.
Re:WTF (Score:5, Informative)
FWIW, I've only found one quote by Lennart Poettering about the entire thing (source [github.com]):
I am not sure I follow. Note that user@.service is already reference counted by the login sessions around. i.e. it is started before the first user session of a specific user is created, and stopped when the last user session ends. I don't follow why that behaviour is not sufficient?
Lennart seems to have learned by now to be careful what he says in public, so I don't expect him to call anyone a moron here.
No, there's a similar debate blowing up on the Fedora list as well, it's just that there's hardly anyone left with the energy to fight the cabal any more.
From the Fedora List: [fedoraproject.org]
Re:WTF (Score:4, Insightful)
On a reasonably POSIX system, yes. Apparently not in POTTERIX.
Comment removed (Score:4, Insightful)
Re: (Score:3)
Except that the way you describe is not the way that screen has always worked. Instead of the straightforward invocation screen on the command line, now it has to be prefixed with all kinds of systemd-specific stuff that wasn't there before.
The first thing I thought of when I saw the headline was "Has Poettering heard of or used screen?" Evidently he's heard of it but doesn't seem to be a user.
This is yet another example of violation of the Principle of Least Surprise on the part of the systemd team.
Comment removed (Score:5, Insightful)
Re:WTF (Score:4, Insightful)
And I guess I have to say this, even though I shouldn't have to say it to anyone older than ten: If you change the way a command is invoked, it is not the same thing; it is a different thing, that may or may not do the same thing, but even if it does, the fact that you call it with a different command means it is not the same thing. More to the point, the fact that it is not only NOT THE SAME THING but also BREAKS THE ORIGINAL THING by changing its functionality means that one idiot with a God complex thinks it's OK to make everyone else scramble to change their code so that it keeps working. And there is no good reason for it. That's bad engineering, bad customer relations, bad stewardship of OSS, and bad karma, for lack of a better term.
If you were working on a project for me and tried to pull something like that, I'd fire you. If you were working with me and not for me, I would have you fired. And at the very least, I'd punch you in the mouth. The last bit is for having the unique combination of chutzpah and stupidity to tell me that your change isn't really a change if I change what I'm doing to meet your newly-discovered aesthetic standards for command invocation.
Re: (Score:3)
Definitely trolling. What an utterly useless waste of space you are.
Re:WTF (Score:5, Insightful)
If I have to know that a particular system is using systemd in order to invoke "screen" correctly, somebody's design is totally broken.
Re:WTF (Score:5, Insightful)
Your analogy is hilariously bad.
Moving from telnet to ssh was a visible break - command name is different, syntax is different, configuration is different etc. If you are a guy who's used to telnet, and you find yourself on a machine that only has ssh, you know that things aren't going to work the way you used to right away, and there's no possibility of confusion - you have to go read the docs etc.
What happened here is a quiet breaking semantic change to an existing invocation. If you type "screen", it still works, and it even behaves as you'd expect. As an experienced user, you know how it's going to behave from there, and you have no reason to expect that behavior will deviate from your expectations (in a potentially destructive way at that!) with no warning.
Re:WTF (Score:4, Interesting)
If a program fucks up and is unresponsive, the correct course of action is not to paper over it with your whiz-bang init system/session manager/ninja/pirate/robot/zombie; the correct course of action is to 1) identify the problem (which you can't do if the process is clobbered automatically) and 2) fix it or file a bug.
Re: (Score:3)
You just start screen, either as a proper .service or as a transient service in its own scope using : "systemd-run --user -scope screen". This will make screen run in its own scope so it won't be destroyed when the users scope is purged at logout.
Why? Why do I have to invoke an obscure systemd command to do something I've done without referencing the OS init system? Do all my bash scripts now need to change to work with systemd?
To be quite honest... (Score:5, Insightful)
Fear not, people of Slashdot, because there is an option to maintain background processes, even after user disconnection.
But this option is not "on" by default. So, yeah, screen and tmux all of a sudden become useless, unless you fiddle with the knobs.
Seriously, now, fsck systemd: Slackware and OpenBSD for me from now on.
Even Mac OS X has the decency not to mess up your tmux sessions when suspending and restoring your session. Fsck systemd.
Re:To be quite honest... (Score:4, Insightful)
You just start them with "systemd-run --user --scope screen" and everything works as before
No it does not work as before. Before you just typed "screen", and it worked on any system.
Life is too short to spend time committing all that extra crap to memory or else having to configure every system you touch with custom shortcuts.
If you think that having to remember to type "systemd-run --user --scope-screen" in front of a frequently used utility (and having the system silently clobber your work if you forget) is reasonable, you're deluded.
Re: (Score:3)
In Unix and its derivatives, frequently used commands are terse. If there's something new for me to learn, it ought to be a half-dozen keystrokes.
No, I am not going to learn to use a new command that has over 40 extra keys to type to support a misfeature that has no benefits to me. No, I am not going to look up that damned command sequence in the man pages every time I'm on a new system and it's not in the history stack.
No other Unix command line utility imposes that burden on the user.
As I originally suspe
Re: (Score:3)
"nohup" exists on every machine.
Your "systemd-run" twaddle does not.
Re:To be quite honest... (Score:4, Insightful)
That was the propaganda but the reality can be seen in those distros and operating systems that do not use SystemD and are not "creaking". SystemD is nothing but a "grand unification" project where a single group is trying to take over all of those patches, scripts and hacks, but since they are new at it and don't seem to fully understand what they are working on there are teething problems.
Notice how the initial promises about "speed" quietly went away?
egotistic breakage charisma (Score:3)
This story: Systemd Starts Killing Your Background Processes By Default
Previous story: Massive Backlash Building Over Windows 10 Upgrades
That's the best conjunction of two headlines that I've noticed in my many years here.
FWIW, I'm a happy PC-BSD user, not that this is a panacea by any means, but there does seem to be less of the "stupidity on a rampage" form of collateral damage.
I pay the price with a lot more "W?TF doesn't Firefox play this media type either?" and I find I have to page bounce to Chrome once or twice almost every day (my FF is plug-in central, my Chrome is naked install).
Unfortunately, I can't even brag that PC-BSD is a successful Poettering removal tool, as I still had to fight some nasty battles with PulseAudio due to rampant ecosystem taint in the package tree that PC-BSD doesn't have the resources to strip out (nor, sadly, does the entire *BSD Avenger collective). Get this, the GUI control I needed to mess with only appears if certain PulseAudio processes are active, but because of my debugging mode, those processes were timing out before I could visit all the places where I thought the GUI control might possibly show up (discoverability anti-pattern in anti-flagrante delicto).
Every large software ecosystem must eventually manage breakage. There are good ways to go about this, and there are bad ways to go about this, and then there are Poettering ways to go about this. It's the added ego problem that seems excessive.
It's all Gnome's fault (Score:5, Interesting)
Apparently, according to some reports, this came about because Gnome can't properly kill off all your sub processes when you log out.
So, systemd to the rescue. Why is anyone using gnome again?!
Re: (Score:3)
That's my take on it as well. Basically, poorly written stuff like PulseAudio doesn't properly shut down when you log off. The solution, obviously, is to break the normal behavior of Linux so that some moronic sound daemon properly shuts down when you log out. It's like watching a train wreck in slow motion.
Re:It's all Gnome's fault (Score:5, Insightful)
It sure looks that way. If that's actually the case, then I am at a loss for words. The amount of bad judgment required to resolve a Gnome bug by modifying the behavior of the OS is stunning.
Re: (Score:3)
I'm guessing that there's been tens, if not hundreds, of userspace bugs that Microsoft has fixed in the kernel. Bugs in the Start Menu, Aero, Metro, File Explorer, and so on. Arguably one of the biggest mistakes was having the font driver so deeply in the kernel, making it susceptible to vulnerabilities that have received patch after patch in the last year. (Oh, and Adobe worked with Microsoft on that part. Yay.)
Consider what this says about modern userspace Linux development: despite working in "the baz
Re: (Score:3, Interesting)
No, Gnome is just the most obvious offender. But the problem exists; notwithstanding how handy things like screen are, to the system (and by extension, to the admin), a long running detached process is indistinguishable from a program that did not cleanly exit. In order to make that distinction, manual intervention is necessary.
The systemd devs just decided to default to kill 'em all in absence of intervention, mostly because with systemd admins finally have the tools to properly separate these kinds of pro
Re:It's all Gnome's fault (Score:4, Insightful)
Despite all the hate I still appreciate what systemd is attempting to do. Now I am not perfectly happy with all the design decisions made in systemd, sometimes grokking new ways of doing things takes a while and I have yet to master all of it. But sometimes I feel like Poettering has been working away at my unpublished list of broken things regarding init.d. I use to be an LTSP server admin at a German university. 400 users via 30 ancient pc's(timeframe was 2004-2008, pc's were 1996-2000 era), running off of one dual-cpu AMD athlon server. Hunting down rogue processes that failed to exit properly was one of the ongoing thorns in my side as an admin. The init system, replete with the run level system, has beek broken in Linux land basically since forever. It was never a matter of which distro you used, they all had problems. There may have been better ways to solve some of these problems, but in contrast to all the fake screaming and cryin you read on slashdot, Poettering, along with several others, attempted to finally do something about it, and even worse damn near every linux distro switched to systemd when systemd was undoubtedly still in it's infancy(this thing, even though it's a baby, has already kicked every other competing init system to the curb, unfinished, with warts and all, it trounces what we had).
I fully suspect to feel the same way about systemd that I felt about pulseaudio: at first pulseaudio was a pain, it was not very reliable and rather pflagmatic at times, involving lots of arcane configuration incantations. However as time went it got better and better, now just about any damn thing I want out of a sound system in computer just works, works reliably and better than any system I have ever used under windows or mac osx. Any person who complains about pulseaudio nowadays, who isn't doing stuff that requires jack anyway(high end professional recording stuff), simply does not remember what a friggin nightmare sound configuration was even a handful of years ago. Every program that does audio had to support artsd, esd, jack, ossv3 and ossv4, alsa dmix etc. Hell has a special place reserved for those who came up with the alsa configuration system. Unless you had one of a half-dozen cards that supported hardware mixing it was not possible to play two sounds at the same time, then it eventually became possible via dmix, but configuring it and getting it to work was a friggin nightmare. Now I can have any number of audio programs running at the same time, can direct their inputs and outputs at will at any time, I can control the volume of each application separately, I can even normalize the sound or run a full-blown equalizer. If i walk out of range with my bluetooth headset on it simply switches over to speakers and returns once my headset syncs again. My 5.1 digital optic audio just works! no more hundreds of hours trying to find the right multichannel mapping for sound, wow, just wow, were almost civilized.
Poettering is all about linux plumbing. You know that unsexy works that nobody likes but we each depend on. However when you change the infrastructure you end up having to adjust some number of other things to work properly. One thing that has always eluded me, is the whole class of applications which run under linux which are not normal "user processes". Things like the display server, ltsp, web servers, databases etc. These things do not fit into the category of user applications, because they require system reconfiguration, and because they are not session bound(anything that is not working my data, available under my account when I log in, is not in my book my "user process"). This class of applications needs to run at once with more(elevated) privileges than a normal user, but at the same time less-ie. they require a managed environment which enables them to run securely at a privileged level, yet still limited in regards to where and how they access data(sandboxing does some of this, running such processes under dedicated users, like dhcpd etc., does some of this too, but neither fully captures the semantics of such application "personalities" for lack of a better word. Cgroups and systemd's PID #1 is an approach to begin martialing such.
Pure Insanity (Score:5, Interesting)
Changes like this make me wonder if the systemd developers even use Linux beyond their local development workstations. This isn't just an inconvenient change, it breaks the expected and decades old behavior of how Unix machines work. This breaks ^Z/bg/disown, it breaks screen, it breaks nohup, etc. Yes, these things can be made to work still but, why do I need to jump through hoops to re-gain the functionality I've relied on for decades? If I'm not aware of this change, how would I even figure out why all my screen sessions died when I logged out? What benefits am I gaining by having this be the default behavior?
Re: (Score:3)
No, my primary machine has no traces of systemd or PulseAudio or any other ultra-invasive piece of software. And it's the most stable, reliable machine I've ever used. By a huge margin. Inviting these ill-advised RedHat technologies onto your machine is just asking for trouble. They are *not* needed in a workstation or server environment. I honestly have no idea why a distro like debian would adopt them. They genuinely detract from the traditional stability of something like debian. I find it absolut
Re: (Score:3)
I think it's both. It's systemd for deciding that this is a sane default behavior and the debian guys for not having the balls to stand up to this bullshit. If you read the bug report linked in the summary, you'll see someone with an @debian.org address say what effectively amounts to, "This seems like a good idea for my laptop and, I can't imagine we have many users that are different from my laptop". Not even fucking kidding: https://bugs.debian.org/cgi-bi... [debian.org]. So, yes, debian is at fault for not havin
Sorry but that's the normal behavior (Score:3)
Re: (Score:3)
Log out = no more of your processes. Normal. Having "nohang" processes, for a regular user != root, is the exception.
If by "nohang" you mean "nohup", then, yes, it is an exception, in the sense that you have to run the command with nohup.
However, with the configuration change being discussed here, nohupping a process apparently isn't sufficient to allow it survive a logout.
Re:Sorry but that's the normal behaviorostost (Score:4, Insightful)
But that's exactly what systemd does! It gives you tools to run these processes in their own scope, so that their resources can be properly managed, and the admin knows that these processes are meant to hang around.
As expected - not a bug a mindset (Score:4)
Still no compelling systemd use case (Score:5, Insightful)
Despite ongoing challenges, I am yet to see a use case presented that the existing initd system cannot handle if you take the time to understand how to use it properly.
I genuinely want to know why systemd is better than initd? As now I am being told that I'll have to make modifications to the way somethings that have worked for years. Do you systemd proponents actually have *any* experience on enterprise systems and how hard it is to get root access to modify these behaviors?
If you want systemd so badly - why don't you just make it a service of initd? Why are you guys, who cannot demonstrate you know any better, subjecting everyone to use this?
Good in theory, bad in practice (Score:5, Informative)
Heck, I implicitly rely on persistence of background processes myself on a semi-regular basis. Doing something that runs counter to this expectation is going to break random stuff, and result in a lot of pissed off sysadmins. This behavior arguably makes sense for desktop distros, but given that Debian is primarily a server distro it should not be the default. Let downstream desktop distros like Ubuntu/Mint/etc. modify the default behavior, if they deem it appropriate (it doesn't even require a code change, it is a config option).
It is also symptomatic of the "all bow down before systemd" mentality, and I have a big problem with that. They may have good intentions, but there are some serious issues with how they're going about implementing their vision.
One simple rule (Score:4, Interesting)
Don't use systemd. It violates the very core philosophy of Unix.
Comment removed (Score:3)
The problem systemd fixes (Score:4, Funny)
*slow clap* (Score:4, Insightful)
Systemd, you've solved a problem that was never really much of a problem.
Re:Well fuck you, systemd (Score:5, Informative)
Or you know use Slackware... it's the oldest Linux Distro and does not use systemd.
Re: (Score:3)
Sorry, Slackware is NOT an option. Nor is Gentoo. (Score:5, Insightful)
Again and again I've heard people like you suggest that Slackware is a replacement for a modern mainstream distro like Debian. Others suggest Gentoo.
Well, the reality is that neither is sufficient.
Slackware is, to put it politely, very primitive. While simplicity is a good thing, Slackware takes it to the point where it becomes a liability.
When using Debian, it's possible to get a full-featured desktop or server set up with very little effort, and this can be done quickly. Thanks to sensible defaults and a practical installer, manual configuration is kept to a minimum.
Slackware, on the other hand, requires far too much manual intervention just to get a minimally usable system set up. Maybe this isn't a problem for a hobbyist who tinkers with Linux on a weekend, but it is a problem for people who are seriously using Linux, especially in a business setting. They can't afford to waste time and effort on Slackware, especially if a distro like Debian manages to avoid such waste.
Gentoo really isn't much better. It's not as bad as Slackware, but Gentoo is still a niche distro, and its whole compilation strategy is wasteful for anyone but hobbyists.
At this point, sensible and experienced Debian users have realized that Debian systemd/GNU/Linux is a lost cause. They've moved to FreeBSD ages ago, or are in the process of doing so. If Slackware and Gentoo are the only viable non-systemd options left for those who want to use Linux, then Linux is just not suitable for use.
FreeBSD gives much of what Debian used to give: stability, reliability, trustworthiness, an excellent packaging system, a superb installer, sensible defaults, no systemd, and an environment that's perfect for both desktops and servers. In some ways FreeBSD is even better than Debian traditionally was: much of the FreeBSD code is released under truly free BSD family licenses, rather than the far more restrictive and less-free GPL family.
Re: Well fuck you, systemd (Score:3)
You use old beater machines instead of virtual machines? God I remember when I did that... So much clutter due to holding on to old computer parts that I'd usually never end up using, but still keeping them "just in case". My last move was so much easier without packing up a garage partially filled with that shit to bring to the next house.
Re:I assumed this was already a default (Score:5, Insightful)
> A multi-user system shouldn't allow unpriviledged users from consuming resources indefinitely
You're an idiot.
If I log on and start vim and two weeks later I've still got that screen sesh up, I sure as fuck do not want my unpriviledged account to have its processes terminate.
Docking/shutdown makes sense. You've turned off that (conceptual) computation device. But that requires the end user to say they're done and shut down. Doing it automatically is incredibly fucking stupid.
Re:I assumed this was already a default (Score:5, Interesting)
What about when I have a long running process I need to run and I don't want it to be stopped if I get disconnected from wifi? Or maybe I know it'll still be running when I have to go home?
The way it is now, if I just disconnect from ssh, they get killed. If i go out of my way to ensure they won't (e.g. start them in a screen session) then they aren't. How is the old way a problem?
Re:I assumed this was already a default (Score:5, Insightful)
How is the old way a problem?
That's systemd in a nutshell (and pulseaudio too). Replace well-known things that are not broken with something obscure and clunky that thinks it's smarter than you.
systemd, unity, iTunes, Windows 10... We live in a world where mediocre aspies decide how other people should use their computers because they work in large footprint organizations that have no competent dictators.
Re: (Score:3)
One of the more bizzare of which is you could speed up performance of X by blocking a port that pulseaudio listens to on the network. There should have been an option in pulseaudio to turn that absurdly resource hungry polling off instead of having to use iptables to block it.
Everything RedHat has put a lot of work into has been embraced, even NetworkMana
Re:I assumed this was already a default (Score:5, Interesting)
No, it wouldn't be. First, if you will contemplate what is involved in saving state, you'll realize what an incredible challenge it would be to do so perfectly every time in every case.
For example, if I start a slow FTP session, how will the magic state saver cope? Remember, the remote server is not taking part in the state saving.
Second, had you done that, wouldn't you be a bit disappointed to find out 24 hours later that the file transfer has made no progress at all?
Screen, nohup, and friends exist explicitly to allow a terminal session to dettach and re-attach as needed. I use screen all the time, especially where a firewall might time out.
It's probably best for the system to work like it's always worked. If they want Potterix to work differently, they should put out a distro.
Re: (Score:3)
New system options
1) FTP command line registers with systemd that's its going to be doing a download over the next 12 hours from a slow server.
2) You run FTP from inside systemd telling the process manager this FTP is going to take 12 hours
3) After you start the FTP process you notify systemd
etc...
Re: (Score:3)
"Wouldn't it be better to save state on logout and restore on login?"
Wouldn't it be better if you learn that for the computer to do things on my behalf it's not needed that I stay in front of the computer, that I don't even need to maintain an interactive session opened for that to happen?
Re: I assumed this was already a default (Score:5, Informative)
Re: I assumed this was already a default (Score:5, Insightful)
Re:I assumed this was already a default (Score:5, Insightful)
Re: (Score:3)
Wouldn't it be better to save state on logout and restore on login?
Why?
This would provide the balance between saving system resources and allowing a user to start off where they left off.
What resources do you think you're going to be saving here? There are various ways of allocating resources to a user and they then use those how they want. restricting this to log on and log off is incredibly stupid.
Of course applications would need to be aware of state saving. Is there already some sort of API for this?
Jesus Christ. We don't need an API, or to add systemd support to anything because it ALREADY FUCKING WORKS.
Re:I assumed this was already a default (Score:5, Insightful)
Because they are remote headless systems and I don't need to stay connected to them in order for them to do the stuff I want them to do?
Re: (Score:3, Insightful)
> A multi-user system shouldn't allow unpriviledged users from consuming resources indefinitely.
man 5 limits.conf
In short, *nix has provided ways to do just that for literal decades.
Re:I assumed this was already a default (Score:5, Insightful)
So I log onto a server, start a all-night process, log off, and shut down my desktop it should mean that my process should also be killed? Or do I have to keep my desktop on all night and hope that the connection doesn't drop just to keep the process running?
Or sometimes I can log on to a system to start a long process which will send me a notification when it's done. Why should I stay logged in taking up resources just so that the process can stay running? It's better for the system for the process to be running in the background and me to be logged off. If I do things properly I set up my job to run at a lower priority but the OS is going to have a good scheduler to ensure that active users are given priority.
Re: (Score:3)
A multi-user system shouldn't allow unpriviledged users from consuming resources indefinitely. It's too easy to starve a system or resources. I think that's one of the reasons behind the isolation dockers provides in the first place. Shut down the container and everything gets cleaned up.
What "multi-user systems"? Multi-user systems died somewhere around the turn of the century, when the personal computers became common.
Secondly the people whinging about there do not give a shit about your concerns over large computer systems. And you should listen to them, because they are the people who run those systems. They are the sysadmins in charge of large clusters of machines they control with the likes of ssh, ansible and puppet. If there is a task left running when they log out, it is becaus
Re:I assumed this was already a default (Score:5, Interesting)
Do that all you want on a desktop. On a server, perhaps nobody cares or perhaps the admin will kill your processes. Keep in mind, if you don't actually touch the pages your allocation only exists in theory. If you do, it'll get swapped out if you don't keep touching it periodically.
Once it becomes obvious you're burning resources for fun, the admin will either drop your ulimits down or terminate access.
I run a few systems where the user is expected to start simulations that may run for weeks. I don't need something to start mysteriously killing those processes off.
Re: (Score:3)
Apt-get install sysvinit-core seems to fix it...
Re:I assumed this was already a default (Score:4, Insightful)
So other than again pointlessly changing the well known and understood API, what's the point of systemd again? How about just leave things the way they were?
That is, when the tty disconnects, it sends SIGHUP to the processes it controls. It's up to those apps to determine what is the right thing to do upon recieving SIGHUP.
Re: (Score:3)
Or you can just not use systemd, if you dont like it then dont use it.
Easy to say, significantly LESS easy to do.. I use/prefer either Debian or Ubuntu, and am currently on Ubuntu 14.04.. Since both the latest Debian (Jessie) and Ubuntu (16.04) now have systemd, as do most other well-known distros. Its beginning to look like I'm going to have to back to my "Linux roots", namely Slackware, where I started, back in 1995, when Ubuntu 14.04 goes out of support in 2019. From what I can gather, Pat V hasn't (nor will he) pollute Slackware with Systemd.
Re: (Score:3)
apt-get install sysvinit-core presents far fewer problems and future surprises. Why swat flies all day when I can just close the screen door?
Google "principle of least astonishment".
Beyond that, the question was "So other than again pointlessly changing the well known and understood API, what's the point of systemd again?", not "How can I turn/burn that particular wart off?
Re:I assumed this was already a default (Score:5, Insightful)
Even with the new settings, no user process will be killed on exit/logout if the user have told the system not to.
Instead of starting the program with with "nohup" you start it with "systemd-run" instead.
Yes. The issue isn't that it can't be done. The issue is that longstanding default behavior has changed. Since it appears that there's no good, solid reason for the change, people are objecting to it. Change for change's sake is bad.
Re: (Score:3)
Yes. The issue isn't that it can't be done. The issue is that longstanding default behavior has changed. Since it appears that there's no good, solid reason for the change, people are objecting to it. Change for change's sake is bad.
Why do you think there no solid reasons for this new default. It is something somebody told you, or are you just presenting what you imagine as facts?
Re: I assumed this was already a default (Score:3)
So it's okay for malware to be running as long as you're logged in, but it has to stop when you log out?
That's the second stupidest thing I've read in this thread.
Re:From a security perspective... (Score:5, Insightful)
Because for most linux is not a desktop os, we use it one servers. I've had logged in screen sessions that date back to when machines were built. Systemd keep thinking that people want it for a desktop os, for their laptop etc. I've got literally thousands of physical boxes running linux that I deal with I've only got one linux laptop so the laptop scenario should never be the default for me, the systemd devs seem to keep thinking their linux laptops are the majority.
Re: (Score:3, Funny)
The functionality remains the same, even with the new systemd defaults. But instead of using "nohup /program/ &" you use "systemd-run --user -scope /program/".
So a slight change in syntax, not a big deal IMHO.
Re:From a security perspective... (Score:4, Insightful)
"Nice shell script you've got there. It would be a shame if something happened to it. Use this command to run it, or else, who knows what might happen. Fucking pathetic.
*For a concrete example, all of your scripts that automatically ssh into a server, start a process with screen, and log out, now break. To name just one thing that I have done on numerous occasions.
Re: (Score:3)
Re: (Score:3)
Or you could edit one line in one config file and get the behaviour you want back. No need to throw a hissy fit.
There is still a huge reason to throw a fit. If I need to kick off some background jobs on a bunch of machines reliably, I will now have to check how the system is configured first, and probably wrap that up in my own nohub-or-systemd-run wrapper, checking if systemd-run even exists, if so, how is logind.conf configured, then use the correct wrapper. All this why? Because some applications aren't respecting the conventions that have existed for ages, so let's make new ones?
Re: (Score:3)
You morons all sound like a bunch of Mac users.
Actually, if, on a Mac running OS X, you do nohup blahblahblah >/tmp/blahblahlog 2>&1 & in a Terminal window in a GUI session, and then log out and log back in again, blahblahblah will still be running (verified experimentally on an El Camino (virtual) machine just now).
(If it warns you that there's a process running in Terminal, and that logging out will kill it, tell it to close the Terminal window anyway; it's lying, the process will survive. I'm not sure what signal is getting sent, if a
Re: (Score:3)
Actually, if, on a Mac running OS X, you do nohup blahblahblah >/tmp/blahblahlog 2>&1 & in a Terminal window in a GUI session, and then log out and log back in again, blahblahblah will still be running (verified experimentally on an El Camino (virtual) machine just now).
Harrumph El Capitan, d00d.
(If it warns you that there's a process running in Terminal, and that logging out will kill it, tell it to close the Terminal window anyway; it's lying, the process will survive. I'm not sure what signal is getting sent, if any, but it ain't SIGKILL - perhaps it's SIGHUP, as nohup's purpose is to make the process ignore SIGHUP.
To be fair, the OS X nohup [apple.com], as well as, apparently, the OS X screen [apple.com] has been modified to call _vprocmgr_detach_from_console() [github.com], and that document is part of a version of tmux ported to OS X.
So perhaps screen, tmux, and nohup need to be modified to, on systems with systemd, do whatever the appropriate magic is necessary, just as is done on OS X.
Re:A total non story .. (Score:4, Insightful)
It _is_ an important story. It is yet another demonstration of the Systemd Cabal's willingness to change _long-standing_ default behaviors without significant fanfare, notice, or adequate justification.
There are far more Linux servers and "appliances" in the world than desktop machines. Many of those non-desktop machines happen to run Debian, Ubuntu, or another systemd distro. If one is considering changing a default behavior, one must keep this fact in mind. It's clear that the Systemd Cabal failed to do so in this case.
Re:A total non story .. (Score:5, Informative)
The issue is the violation of POLA (principle of least astonishment) given that Unix has allowed processes to run after user exit through nohup(1), which dates back to at least 1986:
More like "at least 1975" - nohup dates at least back to V6 [cat-v.org].
Re:Thats demonic (Score:5, Funny)
This is anti-daemonic. Systemd is committing daemon genocide while you log out and turn your back on it.
Re: (Score:3)
Re: (Score:3)
You are exactly correct. Distros will have the final say in conf defaults. I don't see many holding onto the yes value for server branded versions of their distros, way too much breakage. For desktop and workstation, maybe, we will have to see. But seriously, this whole thing is a massive overreaction to a value that can be changed in a text editor in less than two seconds. But of course we all know that any systemd news instantly makes front page because of the massive knee jerk Slashdot has for systemd.
Its something that, if you are unaware of the change, can break things badly, perhaps even messing up ability to remotely administer a server and have to call for remote hands. So IMO its something, the default behavior of which, should not change within a major release version.
However its also the sort of thing I could see a Debian package maintainer deciding is a 'security patch' and pushing it out to stable that way. Similar to what happened with sudo.
Re: (Score:3)
Ordinarily, a user's processes SHOULD all be killed on logout. They're no longer logged on; they're no longer using or entitled to use the machine.
For better or worse, that hasn't been the way UNIX worked since at least the 1975-vintage V6 - you could use nohup, redirect the standard input/output/error, and run in the background to make a process be a job that survives logging out.
However, there will be cases where something long-term needs to go on. How hard is it to add daemons or background services in an administrator or batch context? That's where the long-term stuff should go. Olde days with VM/CMS: CMSBATCH was available to ordinary users if some job would run too long to be practical in foreground in the user account. Submit; it runs when scheduled (by the user or the system, depending on load) and returns results to the user account.
Perhaps UNIX should have had such a mechanism since the beginning, rather than later, for example, getting the at/batch command. For what it's worth, it didn't, only getting it later.
Systemd is *more than* a pain (Score:5, Insightful)
Basically systemd is built on a totally fucked up concept - a concept in which whatever the users do is not important, only system resources count, and if the users do not like it, they can go fuck themselves
That is basically what systemd is - and it perfectly reflects the way systemd's proponents think as well
Re: (Score:3)
The article is wrong. Systemd didn't change anything. Debian's config for systemd changed a default. Either option is a problem for people. But its not unreasonable to assume that users that want to have long running process know more about their systems and thus how to change them than users who want everything to stop when they logout. The change in default makes sense, and systemd is doing the right thing here.
What's a pain is the disruption caused by transitioning from a non-sensible default to a s