Thanks
Thanks
Posted Nov 20, 2014 1:42 UTC (Thu) by JdGordy (subscriber, #70103)In reply to: Thanks by andreashappe
Parent article: Today's Debian technical committee resignation: Ian Jackson
Posted Nov 22, 2014 15:31 UTC (Sat)
by zuki (subscriber, #41808)
[Link] (28 responses)
More recent systemd-activate from the systemd tree implements most of socket activation protocol including Accept=yes/no and multiple sockets (not all socket types, e.g. netlink is missing but that could be fixed). It is not tied to systemd as PID 1, so it could be used a shim easily.
Posted Nov 22, 2014 20:19 UTC (Sat)
by rodgerd (guest, #58896)
[Link] (27 responses)
(It would also be interesting to know how many "traditional Unix is the ONLY WAY" actually run ssh or their web servers out of inetd.)
Posted Nov 23, 2014 1:29 UTC (Sun)
by zuki (subscriber, #41808)
[Link] (26 responses)
Posted Nov 23, 2014 3:05 UTC (Sun)
by mgb (guest, #3226)
[Link] (20 responses)
Not for me, thanks.
Posted Nov 23, 2014 7:31 UTC (Sun)
by smurf (subscriber, #17840)
[Link] (19 responses)
I'd assume that this would decrease it, since this way you do not risk starting it too early (/var/log not yet mounted, or whatever else might cause sshd to fail to start), nor too late (i.e. not at all, if something earlier in the boot sequence fails)
Posted Nov 23, 2014 7:42 UTC (Sun)
by mchapman (subscriber, #66589)
[Link] (18 responses)
If the system is close to being out of memory, then I would expect a socket-activated SSH to be less likely to get you to a shell than a non-socket-activated SSH.
If your only remote access to the system is with SSH, and remotely rebooting it is infeasible or impractical, then this could be a concern.
Posted Nov 23, 2014 9:01 UTC (Sun)
by mgb (guest, #3226)
[Link] (12 responses)
Once your sshd process exists you don't want it to disappear unexpectedly.
Posted Nov 23, 2014 9:29 UTC (Sun)
by mchapman (subscriber, #66589)
[Link]
Posted Nov 23, 2014 16:37 UTC (Sun)
by flussence (guest, #85566)
[Link] (8 responses)
On the other hand, a system using cgroups to indiscriminately purge entire process ancestries will create exactly the problem you're describing... by design!
Posted Nov 23, 2014 16:57 UTC (Sun)
by mgb (guest, #3226)
[Link] (5 responses)
Exactly.
A hypothetical modular portable dependency-based init could have been a useful tool but systemd is the opposite of a tool - it is a restrictive imposition. Systemd's short-sighted design is extraordinarily counter-productive and this becomes glaringly obvious as systemd attempts to move from its desktop niche to the critical server and embedded spaces.
Posted Nov 23, 2014 17:53 UTC (Sun)
by zuki (subscriber, #41808)
[Link] (4 responses)
I agree that for a server this is pointless, but let's say that you are running containers or lightweight VMs, in multiple instances. Then avoiding starting the process can be a nice optimization.
>> On the other hand, a system using cgroups to indiscriminately purge
[snip the rant]
Posted Nov 23, 2014 18:06 UTC (Sun)
by mgb (guest, #3226)
[Link] (3 responses)
You should try pre-systemd Debian Stable which doesn't kill existing sshd connections during upgrades. It's great.
Posted Nov 23, 2014 18:15 UTC (Sun)
by zuki (subscriber, #41808)
[Link] (2 responses)
Once again: existing sshd connections *are* *not* *part* of sshd.service.
(It is possible that there's a bug in your Debian package or setup or whatever... I can only say that it works for me and apparently for most people, and of course is *designed* to work this way. If it doesn't work for you, please provide the details and we'll work on a fix. Probably best to do this on the distribution bugtracker rather than here though.)
Posted Nov 23, 2014 18:43 UTC (Sun)
by mpr22 (subscriber, #60784)
[Link] (1 responses)
Posted Nov 25, 2014 16:31 UTC (Tue)
by nix (subscriber, #2304)
[Link]
Posted Nov 23, 2014 23:28 UTC (Sun)
by mchapman (subscriber, #66589)
[Link] (1 responses)
Except it doesn't. There are two reasons for this.
First, pam_systemd will move the SSH child process into a different cgroup.
Second, even if it didn't do this, the sshd.service contains KillMode=process, which means only the main process is killed upon stop or restart. Other processes in the sshd.service cgroup are unaffected.
Posted Nov 24, 2014 20:16 UTC (Mon)
by smurf (subscriber, #17840)
[Link]
Too bad (from the point of view of the anti-systemd crowd, that is).
Posted Nov 24, 2014 20:18 UTC (Mon)
by smurf (subscriber, #17840)
[Link] (1 responses)
Posted Nov 24, 2014 20:48 UTC (Mon)
by mgb (guest, #3226)
[Link]
The subthread to which you are responding is concerned with zuki's suggestion http://lwn.net/Articles/622790/ that sshd should exit on idle.
Posted Nov 24, 2014 13:02 UTC (Mon)
by james (subscriber, #1325)
[Link] (1 responses)
Posted Nov 25, 2014 16:32 UTC (Tue)
by nix (subscriber, #2304)
[Link]
Posted Nov 24, 2014 18:33 UTC (Mon)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
But of course, it's easier to do with systemd and socket-activation is useful because it will restart your daemon in case of failures...
Posted Nov 24, 2014 19:27 UTC (Mon)
by rodgerd (guest, #58896)
[Link] (1 responses)
Posted Nov 24, 2014 20:00 UTC (Mon)
by Cyberax (✭ supporter ✭, #52523)
[Link]
There's a slight possibility of a livelock when sshd is killed immediately after it's restarted by systemd. Perhaps the "OOMAdjustDelay" setting can be added to systemd?
Posted Nov 23, 2014 9:32 UTC (Sun)
by rodgerd (guest, #58896)
[Link] (4 responses)
The proper Unix way would be to have all those traditional services spawn out of inetd and use tools like tcpwrappers for access control; if you really need security you should be using something like stunnel rather than building it all into the basic tool. All that code living together is obviously a much bigger attack service.
And have you seen the attitude of the maintainer? He rejects portability patches and keeps saying rude things about other platforms!
All of this is against traditional Unix principles and will be a disaster for Unix, mark my words.
Posted Nov 23, 2014 18:35 UTC (Sun)
by dlang (guest, #313)
[Link] (3 responses)
Posted Nov 24, 2014 20:22 UTC (Mon)
by smurf (subscriber, #17840)
[Link] (2 responses)
Posted Nov 25, 2014 2:22 UTC (Tue)
by dlang (guest, #313)
[Link] (1 responses)
Posted Nov 25, 2014 16:33 UTC (Tue)
by nix (subscriber, #2304)
[Link]
Thanks
One could argue that inetd/xinetd already do this, although not with the systemd protocol.
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
>> activation. You can still do the normal "restart daemon, log in on new
>> sshd to verify it works, log out of old sshd when it's safe" routine,
>> though that of course renders this micro-optimization pointless.
Not if exit-on-idle is implemented. If it is, you can do a test login after upgrade, and still have the process go away after while.
>> entire process ancestries will create exactly the problem you're
>> describing... by design!
> Exactly.
I don't grok. When an SSH session is started, the ssh instance and user process forked off it are moved to a separate scope unit, which of course also means a different subtree in the cgroup hierarchy. So individual sessions are completely independent of the ssh service. As for the sshd service itself, yes, all processes in it are stopped during restart. That pretty much describes the basic functionality of systemd achieved with cgroups. If you think something is wrong with "purging" all processes of a service when it is stopped, please explain.
Thanks
Thanks
>> service when it is stopped, please explain.
> You should try pre-systemd Debian Stable which doesn't kill existing sshd
> connections during upgrades. It's great.
After they are established they are independent and are not touched when sshd.service is stopped or restarted.
Asking mgb for details about specific failures of systemd-based systems is a waste of electrons; they have explicitly stated on this site a refusal to use systemd or help debug systemd.
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
I'd expect a socket-activated sshd that is activated from init to be more likely to work (perhaps after a minute or two), simply because init won't be killed by the OOM killer.
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks
Thanks