Discussion:
New Essential package procps-base
Add Reply
Craig Small
2023-11-14 06:40:01 UTC
Reply
Permalink
Hello,
For quite some time (since 2006!) there has been a discussion at[1] about
changing from the sysvinit-utils version of pidof to the procps one. A
quick scan of the various distributions shows that only Debian and Ubuntu
(and I assume most other downstreams) use the sysvinit-utils version.

So to rehash some old drafts, here's the proposal.

What:
Create a new package procps-base. This uses the existing procps source
package and just enable building of pidof. procps-base will be an Essential
package and only contain pidof.

Why:
This would bring the pidof variant in line with other distributions.
sysvinit-utils would no longer need to be Essential (though that's a
separate issue) and would only have init-d-script, fstab-decode, and
killall5.

The majority of usage of pidof is in init or pre/post scripts, which really
should be using the LSB pidofproc function. That function in turn
optionally uses pidof if the pidfile parameter is not given. That's
probably a way forward for sometime in the future to not need procps-base
Essential, but it is a way off.

sysvinit-utils requires only libc6 while procps-base require libproc-2 but
this is the same library used for the ps,top,w etc tools which are
installed on most systems.


1: https://bugs.debian.org/810018
Andreas Henriksson
2023-11-14 09:50:01 UTC
Reply
Permalink
Hello,
Post by Craig Small
Hello,
For quite some time (since 2006!) there has been a discussion at[1] about
changing from the sysvinit-utils version of pidof to the procps one. A
quick scan of the various distributions shows that only Debian and Ubuntu
(and I assume most other downstreams) use the sysvinit-utils version.
I support using procps implementation in Debian, to align us with the
rest of the world.
Post by Craig Small
So to rehash some old drafts, here's the proposal.
Create a new package procps-base. This uses the existing procps source
package and just enable building of pidof. procps-base will be an Essential
package and only contain pidof.
I however do not think pidof needs to be part of the Essential set.

Instead I think pidof can just be part of procps package. The
sysvinit-utils package will then pull in procps via a dependency (once
sysvinit-utils stops being Essential), which would smooth the transition
for all sysvinit users until LSB pidofproc has been implemented in all
init scripts.
Post by Craig Small
This would bring the pidof variant in line with other distributions.
sysvinit-utils would no longer need to be Essential (though that's a
separate issue) and would only have init-d-script, fstab-decode, and
killall5.
The majority of usage of pidof is in init or pre/post scripts, which really
should be using the LSB pidofproc function. That function in turn
optionally uses pidof if the pidfile parameter is not given. That's
probably a way forward for sometime in the future to not need procps-base
Essential, but it is a way off.
Additionally most uses of pidof is `if pidof [...]; then` which will
expand to false/else when the pidof command is not available (which it
should be on all "normal" systems, as procps is already Priority
important).

A number of years ago I tested booting a regular debootstrapped system
(with all priority important packages, etc) with sysvinit-utils excluded
and that did not show a single warning about missing pidof. Someone
might want to repeat that experiment.
Post by Craig Small
sysvinit-utils requires only libc6 while procps-base require libproc-2 but
this is the same library used for the ps,top,w etc tools which are
installed on most systems.
1: https://bugs.debian.org/810018
Regards,
Andreas Henriksson
Helmut Grohne
2023-11-14 10:20:02 UTC
Reply
Permalink
Hi Craig,
Post by Craig Small
Hello,
For quite some time (since 2006!) there has been a discussion at[1] about
changing from the sysvinit-utils version of pidof to the procps one. A
quick scan of the various distributions shows that only Debian and Ubuntu
(and I assume most other downstreams) use the sysvinit-utils version.
So to rehash some old drafts, here's the proposal.
Create a new package procps-base. This uses the existing procps source
package and just enable building of pidof. procps-base will be an Essential
package and only contain pidof.
I welcome the effort in general. Like Andreas, I question whether having
pidof remain essential is useful. A quick codesearch
https://codesearch.debian.net/search?q=%5Cbpidof%5Cb&literal=0 suggests
that we have less than 500 source packages that even mention it. Many
uses are in test suites or documentation, so the final number will be
lower still.

If we agree that pidof should not be essential, the next question is
whether we need that procps vs procps-base split. Andreas suggests "no".
I don't have a strong opinion on that one.

Let me suggest an alternative transition plan. We extend sysvinit-utils
with a new virtual package "pidof". Then we MBF packages using pidof to
add a dependency on pidof. Once a significant portion of those bugs is
fixed, we move pidof out of sysvinit-utils and have it drop that virtual
package. procps or procps-base can then add pidof (with Breaks+Replaces
for sysvinit-utils and Provides: pidof) moving it out of the essential
set in the process. Any remaining bugs would be bumped to rc-severity at
that point.
Post by Craig Small
This would bring the pidof variant in line with other distributions.
sysvinit-utils would no longer need to be Essential (though that's a
separate issue) and would only have init-d-script, fstab-decode, and
killall5.
I fear sysvinit-utils being essential is not separate (see below). It
really needs to be done together, so additionally there would have to be
another MBF for those other tools asking to add dependencies.
Post by Craig Small
The majority of usage of pidof is in init or pre/post scripts, which really
should be using the LSB pidofproc function. That function in turn
optionally uses pidof if the pidfile parameter is not given. That's
probably a way forward for sometime in the future to not need procps-base
Essential, but it is a way off.
For as long as sysvinit-utils contains /lib/lsb/init-functions, it'll
have to include pidof or depend on it. Therefore the pidof provider can
only become non-essential once sysvinit-utils is non-essential. If you
see the change in implementation as more urgent than making all of it
non-essential, then procps-base is needed indeed.
Post by Craig Small
sysvinit-utils requires only libc6 while procps-base require libproc-2 but
this is the same library used for the ps,top,w etc tools which are
installed on most systems.
Yeah, please don't increase the essential set. The addition would be
very unwelcome to embedded systems.

So in essence, you asked for changing the pidof implementation and
Andreas and me try to turn this into a much bigger quest of making it
non-essential. While these matters are related, they can be done
independently in principle and if you do not want to take on the
non-essential part, I fear I see little alternatives to that procps-base
proposal.

Pulling procps-base into the essential set also adds it to the bootstrap
set. That also adds numactl to the bootstrap set. I'd rather not have it
grown if possible. Both are currently cross buildable, so it's not the
end of the world.

Helmut
Luca Boccassi
2023-11-14 10:50:01 UTC
Reply
Permalink
Post by Helmut Grohne
So in essence, you asked for changing the pidof implementation and
Andreas and me try to turn this into a much bigger quest of making it
non-essential. While these matters are related, they can be done
independently in principle and if you do not want to take on the
non-essential part, I fear I see little alternatives to that procps-base
proposal.
Yeah, let's not make this task impossibly huge and lengthy, please.
Using the same implementation as every other distro has immediate
benefits for everybody, packagers and users. Rearranging the packaging
details and priorities and whatnot is pretty much an internal-only
detail - which doesn't mean it's not good or useful or worth doing,
just that I don't think it's worth blocking the first part for it, as
it can happen just as well later. The procps-base proposal looks good
to me.
Luca Boccassi
2024-05-24 00:30:01 UTC
Reply
Permalink
Post by Luca Boccassi
Post by Helmut Grohne
So in essence, you asked for changing the pidof implementation and
Andreas and me try to turn this into a much bigger quest of making it
non-essential. While these matters are related, they can be done
independently in principle and if you do not want to take on the
non-essential part, I fear I see little alternatives to that
procps-base
Post by Luca Boccassi
Post by Helmut Grohne
proposal.
Yeah, let's not make this task impossibly huge and lengthy, please.
Using the same implementation as every other distro has immediate
benefits for everybody, packagers and users. Rearranging the
packaging
Post by Luca Boccassi
details and priorities and whatnot is pretty much an internal-only
detail - which doesn't mean it's not good or useful or worth doing,
just that I don't think it's worth blocking the first part for it, as
it can happen just as well later. The procps-base proposal looks good
to me.
Hello Craig,

It's been six months since the last update on this bug - would it be
possible to finally take this over the finishing line? Thanks!
--
Kind regards,
Luca Boccassi
Luca Boccassi
2025-02-19 12:30:01 UTC
Reply
Permalink
Post by Craig Small
Post by Luca Boccassi
Post by Helmut Grohne
So in essence, you asked for changing the pidof implementation and
Andreas and me try to turn this into a much bigger quest of
making
Post by Craig Small
it
Post by Luca Boccassi
Post by Helmut Grohne
non-essential. While these matters are related, they can be done
independently in principle and if you do not want to take on the
non-essential part, I fear I see little alternatives to that
procps-base
Post by Luca Boccassi
Post by Helmut Grohne
proposal.
Yeah, let's not make this task impossibly huge and lengthy, please.
Using the same implementation as every other distro has immediate
benefits for everybody, packagers and users. Rearranging the
packaging
Post by Luca Boccassi
details and priorities and whatnot is pretty much an internal-only
detail - which doesn't mean it's not good or useful or worth doing,
just that I don't think it's worth blocking the first part for it, as
it can happen just as well later. The procps-base proposal looks good
to me.
Hello Craig,
It's been six months since the last update on this bug - would it be
possible to finally take this over the finishing line? Thanks!
Hello again,

It's almost a year since the last ping, and more than 9 years since
this bug was originally opened. Is there any blockers left for sorting
this out or is it good to go?

Thanks!
Craig Small
2025-02-20 09:30:01 UTC
Reply
Permalink
Hi Luca,
The issue is getting from where we are to where we want to be without
breaking everything. In other words, it interim steps along the way.

Admittedly I haven't thought *too* much about it, but pidof (either one)
needs to be installed all the time, without dragging in all of procps.
There didn't seem to be a good way of doing it.

If you can find this twisty path, I'm happy to hear about it.

- Craig
Post by Helmut Grohne
Post by Craig Small
Post by Luca Boccassi
Post by Helmut Grohne
So in essence, you asked for changing the pidof implementation
and
Post by Craig Small
Post by Luca Boccassi
Post by Helmut Grohne
Andreas and me try to turn this into a much bigger quest of
making
Post by Craig Small
it
Post by Luca Boccassi
Post by Helmut Grohne
non-essential. While these matters are related, they can be done
independently in principle and if you do not want to take on the
non-essential part, I fear I see little alternatives to that
procps-base
Post by Luca Boccassi
Post by Helmut Grohne
proposal.
Yeah, let's not make this task impossibly huge and lengthy, please.
Using the same implementation as every other distro has immediate
benefits for everybody, packagers and users. Rearranging the
packaging
Post by Luca Boccassi
details and priorities and whatnot is pretty much an internal-only
detail - which doesn't mean it's not good or useful or worth doing,
just that I don't think it's worth blocking the first part for it,
as
Post by Craig Small
Post by Luca Boccassi
it can happen just as well later. The procps-base proposal looks
good
Post by Craig Small
Post by Luca Boccassi
to me.
Hello Craig,
It's been six months since the last update on this bug - would it be
possible to finally take this over the finishing line? Thanks!
Hello again,
It's almost a year since the last ping, and more than 9 years since
this bug was originally opened. Is there any blockers left for sorting
this out or is it good to go?
Thanks!
Luca Boccassi
2025-02-20 10:10:01 UTC
Reply
Permalink
Post by Craig Small
Hi Luca,
The issue is getting from where we are to where we want to be without breaking everything. In other words, it interim steps along the way.
Admittedly I haven't thought *too* much about it, but pidof (either one) needs to be installed all the time, without dragging in all of procps.
There didn't seem to be a good way of doing it.
If you can find this twisty path, I'm happy to hear about it.
How about, uploaded at the same time:

- src:procps with a new procps-pidof binary package that
breaks/replaces current sysvinit-utils and with prio: essential
- drop pidof and prio:essential from sysvinit-utils and add depends on
procps-pidof

Shouldn't this work?
Craig Small
2025-02-25 09:30:01 UTC
Reply
Permalink
Post by Luca Boccassi
- src:procps with a new procps-pidof binary package that
breaks/replaces current sysvinit-utils and with prio: essential
- drop pidof and prio:essential from sysvinit-utils and add depends on
procps-pidof
There's also the case that packages that have an implicit dependency on
sysvinit-utils will have an explicit one.
pidof would ideally be built statically, so not to pull in libprocps.

There was also the issue about init scripts sourcing init-d-script. systemd
unit files don't need this but there are still quite a few like this.

pidof is also a symlink to killall5, I assume replaces works with them but
not 100% sure.

Probably the biggest problem is Trixie freeze, its about 3 weeks away.
There was a discussion about this change a while ago, but I'm not sure if
we can make it this time or best to wait until after Trixie.

- Craig
Post by Luca Boccassi
Shouldn't this work?
Craig Small
2025-02-25 09:50:01 UTC
Reply
Permalink
Hi Debian Release Team,

I released probably the best way of knowing if "we have the time" or not is
to ask you.
So what is this change?

It is replacing the pidof in sysv-init-utils with the pidof in procps.
This will involve making a new Essential package procps-base which will
only have pidof statically linked (to not pull in libproc-2).
Then sysv-init-utils would remove pidof and not be marked Essential.

There is some talk of in the long-run making packages needing pidof to
depend on it, but that is a while off and I'm not sure its possible.

- Craig

---------- Forwarded message ---------
From: Craig Small <***@debian.org>
Date: Tue, 25 Feb 2025 at 20:24
Subject: Re: Bug#810018: New Essential package procps-base
Post by Luca Boccassi
- src:procps with a new procps-pidof binary package that
breaks/replaces current sysvinit-utils and with prio: essential
- drop pidof and prio:essential from sysvinit-utils and add depends on
procps-pidof
There's also the case that packages that have an implicit dependency on
sysvinit-utils will have an explicit one.
pidof would ideally be built statically, so not to pull in libprocps.

There was also the issue about init scripts sourcing init-d-script. systemd
unit files don't need this but there are still quite a few like this.

pidof is also a symlink to killall5, I assume replaces works with them but
not 100% sure.

Probably the biggest problem is Trixie freeze, its about 3 weeks away.
There was a discussion about this change a while ago, but I'm not sure if
we can make it this time or best to wait until after Trixie.

- Craig
Post by Luca Boccassi
Shouldn't this work?
Craig Small
2025-03-03 20:20:01 UTC
Reply
Permalink
I don't think this is a change that should be done this close to the
freeze.
Please stage this change in experimental if you wish, but let's postpone
it
until forky.
btw, the transition suggested by Helmut on [1] sounds reasonable.
Thanks Emilio,
I'll wait until after release. Then get on with it.

- Craig

Guillem Jover
2023-11-15 12:10:01 UTC
Reply
Permalink
Hi!
Post by Craig Small
Create a new package procps-base. This uses the existing procps source
package and just enable building of pidof. procps-base will be an Essential
package and only contain pidof.
This would bring the pidof variant in line with other distributions.
sysvinit-utils would no longer need to be Essential (though that's a
separate issue) and would only have init-d-script, fstab-decode, and
killall5.
I'm all in for shrinking the essential-set. If there is consensus to
switch pidof implementations that also seems fine to me in the abstract.
But this shuffling around of essential-ness and new tiny packages and
stuff seems a bit unnecessary to me, more so when this increases the
bootstrapping-set. I'd also rather see instead a _proper_ transition to
get sysvinit-utils out of the essential-set, and then at some later
point procps can take over pidof.

Then there's the following, which I guess complicates things:

$ dpkg -S bin/pidof | cut -d: -f2
/bin/pidof

Also why is killall5 not a candidate too? In any case the pidof CLI
interface does not seem too big, so this does not feels urgent to me,
given the trade-offs.
Post by Craig Small
The majority of usage of pidof is in init or pre/post scripts, which really
should be using the LSB pidofproc function. That function in turn
optionally uses pidof if the pidfile parameter is not given. That's
probably a way forward for sometime in the future to not need procps-base
Essential, but it is a way off.
I think the status_of_proc function could be switched to use
start-stop-daemon (s-s-d) --status instead of pidofproc. To replace
pidof inside pidofproc I guess s-s-d could grow some option to print
the pid, I'd be happy to implement that. After doing a quick scan over
codesearch.debian.org, I notice that it looks like many current uses
of pidofproc should instead probably be using status_of_proc, and others
seem to just be fetching the pid to then perform some action that could
instead all be done directly with s-s-d.

Thanks,
Guillem
Loading...