Bug#947847: please install systemd-sysusers using update-alternatives

2020-01-30 Thread Josh Triplett
On Mon, Jan 27, 2020 at 06:16:14PM +0100, Svante Signell wrote:
> It is as simple as:
> if ps -p1|grep -q "systemd"; then

This is not the correct way to detect whether systemd is the current
init system. You want:

if test -d /run/systemd/system; then

See https://www.freedesktop.org/software/systemd/man/sd_booted.html

>  
> else
>  
> fi

"exec", not "install".

- Josh Triplett



Re: Bug#947847: please install systemd-sysusers using update-alternatives

2020-01-30 Thread Anthony DeRobertis

On 1/30/20 7:02 AM, Thomas Goirand wrote:

This is normally solved if using pre-depends, which ensure that a
package is configured before using it (and not just unpacked).


Having everything using sysusers have versioned Pre-Depends on systemd | 
opensysusers would probably minimize the problem, but could potentially 
be a fair number of Pre-Depends to add. (I have no idea if non-versioned 
Pre-Depends on a virtual package works, if so that'd be better. If not, 
it'd also require adjusting them all if another alternative is introduced.)


I'm not sure what the risk of dependency resolution unexpectedly 
changing a system to use opensysusers is. Or of it deciding to install 
systemd when the admin wants to use opensysusers — that is probably a 
higher risk since systemd would be listed as the first alternative.


Not saying any of this is a showstopper, of course, just that its a 
downside/potential complication to weigh.




Bug#947847: please install systemd-sysusers using update-alternatives

2020-01-30 Thread Didier 'OdyX' Raboud
Le jeudi, 30 janvier 2020, 00.28:36 h CET Thomas Goirand a écrit :
> On 1/29/20 4:31 PM, Didier 'OdyX' Raboud wrote:
> > Software installed as /bin/systemd-* , created within the systemd project,
> > to fulfill systemd's view of the world, takes a reasonable hit on the
> > binaries' namespace: "systemd-*". Really, we should be thankful that the
> > systemd project actually started using /bin/systemd-sysusers and not just
> > /bin/sysusers. To extend on this, I think it's obvious that what the
> > "systemd-sysusers" binary name _says_ really is "this is a
> > systemd-specific utility".
> 
> They probably should be thanks to save the namespace, however, they
> shouldn't be for pushing for bundling many different things in a single
> software.

The way I look at this is: the "systemd software team" added a software they 
had a need (or a vision) for, and added it in their usual way: by adding it in 
their repository [0]. Then other projects noticed this new piece of software 
and found it interesting, hence started to use it, because it filled a need 
they had, or replaced older codepaths with this new tool. 

> Let's say I was proposing an alternative implementation of
> /usr/sbin/adduser (note that it doesn't have a software name in its
> path...), would you allow it? Hopefully yes, if it had the same
> functionalities, plus some other properties and improvement (like not
> being written in perl... :)

I'm not sure whether you brought this example on purpose, because Debian 
already ships adduser (in perl), and useradd (in C). And the perl version is 
the enhancement of the C version. But they don't carry the same name. And this 
matters; it's a question of honouring interface promises.

To answer your question directly: I don't think Debian should ever allow to 
pick between different /usr/sbin/adduser implementations, per system, no. But 
it could eventually be replaced, like we migrated to dash as /bin/sh: for 
Lenny it was possible to switch to dash as /bin/sh, for Squeeze it was 
enforced on all hosts.

> Why is it controversial here?

Because you're asking to replace a piece of software made by the systemd 
project, in the systemd repositories, shipped in the systemd package, 
knowingly used by other projects as being from systemd. What would be your 
stance as OpenRC maintainer if I asked you to add a update-alternatives for
/sbin/openrc-run for my /sbin/pyopenrc-run?

> Some of us have complained about the non-modularity of systemd. My idea
> was to prove them wrong, and that we can replace some of the components
> that aren't that tightly integrated.

Please don't use the Debian archive (and project) to prove other projects 
wrong, really.

> It feels like upstream also declares systemd-sysusers as an independent
> component, and kind of agree with me on this specific point.

What I read from the systemd project on [1] is "some of our software doesn't 
need to run on hosts with systemd as init". But what I understand from your 
position is "as some of the systemd software doesn't need to run on hosts with 
systemd as init, we can replace them with alternative software". If that's 
what you're saying, I don't think the conclusion follows from the observation.

But holding the systemd software (and hence their Debian maintainers) up to 
their promises (as is done in #946456) is a very good way to go, and a burden 
I feel is reasonable on the systemd maintainers' shoulders. Once, and if that 
is sorted out, packages would need to amend their dependencies to depend on 
systemd-sysusers; opensysusers could then Conflict/Provides systemd-sysusers 
for example; all this without the need for update-alternatives.

(I'd also argue that providing systemd-sysusers in its own binary package [or 
systemd-utils] mostly makes opensysusers purposeless.)

> I'm simply asking *Debian* (not systemd maintainers) to allow multiple
> implementations of the same functionality (ie: adding users using a data
> file format, which happens to have been invented by the systemd project).

It's already possible; maintainers can use opensysusers _now_.

> > My answer to this is that /bin/systemd-sysusers _is_ a systemd interface,
> > with a systemd-* name
> 
> The binary name is very deceptive and annoying. I wished it was packaged
> and maintained separately, because it has very little to do with an init
> system.

It seems you're reading systemd-* to say "comes with systemd the init system", 
where I read "systemd-*" to say "comes from the systemd project". As I said 
earlier, we should be _glad_ that the systemd project innovates in their space 
using their namespace. Just imagine for a second if they had used
/usr/sbin/adduser (because that's what it does, right?).

> > Please let's not use this as a point of argumentation.

You can't just dismiss my points because you don't agree with them. I stand to 
thinking this point is central: if the systemd package had started shipping 
/usr/sbin/sysusers, you would have a _much stron

Bug#947847: please install systemd-sysusers using update-alternatives

2020-01-30 Thread Thomas Goirand
On 1/30/20 7:16 AM, Anthony DeRobertis wrote:
> There are some more that come to mind:
> 
>  * if we convert the exiting name to an alternative, there is the
>    somewhat interesting work of actually changing a file over from an
>    executable shipped in the package to an alternative, which would
>    normally be set up by postinst. That could leave an uncomfortably
>    large window during upgrade where the system would be broken (and
>    possibly not boot) if interrupted.

This is normally solved if using pre-depends, which ensure that a
package is configured before using it (and not just unpacked).

>  * if we use a new, different name, then we've introduced a
>    Debian-specific interface. One of the nice things about most of the
>    Linux world standardizing on systemd is increased cross-distro
>    compatibility; here we'd be breaking it.

That's exactly what made me think that using the original name was less
Debian wide work indeed. Though because of the binary name prefixed with
"systemd-" this is less elegant than standardizing on /bin/sysusers.

Cheers,

Thomas Goirand (zigo)



Bug#947847: please install systemd-sysusers using update-alternatives

2020-01-30 Thread Philip Hands
Svante Signell  writes:

> On Wed, 2020-01-29 at 12:23 -0800, Moritz Mühlenhoff wrote:
>> Simon McVittie wrote:
>> > I think we have a fairly good picture of the costs that would be
>> > incurred from using alternatives:
>>
>> Plus in the case of opentmpfiles; a pile of security issues: systemd-
>> tmpfiles addresses a number of complex races using low level
>> primitives like openat() et al. or O_PATH, while opentmpfiles is
>> implemented in shell.
>
> Do you mean that shell scripts cannot cannot handle such issues??

If you are asking that question, then I suspect that your knowledge of
the problems of shell scripting may be sufficiently limited to mean that
the only useful way to answer it would be to say:

  Yes.

> So C-code is safe by construction, do you really believe in that?

What a ludicrous question -- well done for surpassing the previous one.

Cheers, Phil.
--
|)|  Philip Hands  [+44 (0)20 8530 9560]  HANDS.COM Ltd.
|-|  http://www.hands.com/http://ftp.uk.debian.org/
|(|  Hugo-Klemm-Strasse 34,   21075 Hamburg,GERMANY


signature.asc
Description: PGP signature