Bug#1039142: busybox: ships sysv-init script without systemd unit

2023-11-16 Thread Michael Biebl

Am 17.11.23 um 02:54 schrieb Michael Biebl:


That should do:



[snip patch]

oops, dropped one line too much from debian/rules.

Fixed patch attached.

diff --git a/debian/rules b/debian/rules
index 04018718b..b24b8f46f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -176,5 +176,4 @@ override_dh_installsystemd-indep:
 # explicitly list all packages with .service files here
dh_installsystemd -pbusybox-syslogd --name=busybox-klogd
dh_installsystemd -pbusybox-syslogd
-# the following does not work (see #1039142 for details):
-#  dh_installsystemd -pudhcpd --no-enable --no-start
+   dh_installsystemd -pudhcpd --no-enable
diff --git a/debian/udhcpd.service b/debian/udhcpd.service
index 0cdc24bc7..0d01d9722 100644
--- a/debian/udhcpd.service
+++ b/debian/udhcpd.service
@@ -1,7 +1,7 @@
 [Unit]
 Description=Busybox udhcpd DHCP daemon
 Documentation=man:udhcpd(8)
-After=syslog.service network.target
+After=network.target
 
 [Service]
 Environment=DHCPD_OPTS="-S"


OpenPGP_signature.asc
Description: OpenPGP digital signature


Bug#1039142: busybox: ships sysv-init script without systemd unit

2023-11-16 Thread Michael Biebl

On Tue, 14 Nov 2023 17:41:23 +0300 Michael Tokarev  wrote:

14.11.2023 14:56, Luca Boccassi wrote:
> On Mon, 13 Nov 2023 18:42:09 +0300 Michael Tokarev 
> wrote:
..

>> With just dh_installsystemd --no-enable, it is still started.
>> With dh_installsystemd --no-enable --no-start, it is started
>> as well, - apparently because initscript is started.  Also,
>> with --no-enable --no-start, it is not restarted on upgrades
>> if enabled locally.
>>
>> After doing several iterations, I decided to abandon this attempt, -
>> it just does not work, and I've no time to fight with the tools.
>>
>> If someone has a working recipe for all this madness, please
>> share a patch for d/rules.
>>
>> Tagging with "help" for now.
> 
> Could you please share a branch or a patch with your attempt? What you

> tried should work, but it's hard to say without looking at the
> implementation in details.

Sure thing, it is in current busybox master on salsa, here:

https://salsa.debian.org/installer-team/busybox/-/blob/master/debian/rules#L172

with udhcpd.service & udhcpd.init in the same dir.



That should do:


diff --git a/debian/rules b/debian/rules
index 04018718b..54e5cc225 100755
--- a/debian/rules
+++ b/debian/rules
@@ -175,6 +175,4 @@ execute_before_dh_installinit-indep:
 override_dh_installsystemd-indep:
 # explicitly list all packages with .service files here
dh_installsystemd -pbusybox-syslogd --name=busybox-klogd
-   dh_installsystemd -pbusybox-syslogd
-# the following does not work (see #1039142 for details):
-#  dh_installsystemd -pudhcpd --no-enable --no-start
+   dh_installsystemd -pudhcpd --no-enable
diff --git a/debian/udhcpd.service b/debian/udhcpd.service
index 0cdc24bc7..0d01d9722 100644
--- a/debian/udhcpd.service
+++ b/debian/udhcpd.service
@@ -1,7 +1,7 @@
 [Unit]
 Description=Busybox udhcpd DHCP daemon
 Documentation=man:udhcpd(8)
-After=syslog.service network.target
+After=network.target

 [Service]
 Environment=DHCPD_OPTS="-S"



Only "--no-enable" is necessary. disabled services won't be (re)started.
Once enabled by the user, future package upgrades will restart the service.

I've also dropped After=syslog.service as syslog is socket activated by 
default, so this is not necessary.



root@pluto:~# apt install /tmp/udhcpd_1.36.1-5_all.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'udhcpd' instead of '/tmp/udhcpd_1.36.1-5_all.deb'
The following NEW packages will be installed:
  udhcpd
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/12.4 kB of archives.
After this operation, 51.2 kB of additional disk space will be used.
Get:1 /tmp/udhcpd_1.36.1-5_all.deb udhcpd all 1:1.36.1-5 [12.4 kB]
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Selecting previously unselected package udhcpd.
(Reading database ... 403057 files and directories currently installed.)
Preparing to unpack /tmp/udhcpd_1.36.1-5_all.deb ...
Unpacking udhcpd (1:1.36.1-5) ...
Setting up udhcpd (1:1.36.1-5) ...
udhcpd.service is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.12.0-1) ...

root@pluto:~# systemctl status udhcpd.service
○ udhcpd.service - Busybox udhcpd DHCP daemon
 Loaded: loaded (/usr/lib/systemd/system/udhcpd.service; disabled; 
preset: enabled)

 Active: inactive (dead)
   Docs: man:udhcpd(8)





OpenPGP_signature.asc
Description: OpenPGP digital signature


Bug#1039142: busybox: ships sysv-init script without systemd unit

2023-11-14 Thread Michael Tokarev

14.11.2023 14:56, Luca Boccassi wrote:

On Mon, 13 Nov 2023 18:42:09 +0300 Michael Tokarev 
wrote:

..


With just dh_installsystemd --no-enable, it is still started.
With dh_installsystemd --no-enable --no-start, it is started
as well, - apparently because initscript is started.  Also,
with --no-enable --no-start, it is not restarted on upgrades
if enabled locally.

After doing several iterations, I decided to abandon this attempt, -
it just does not work, and I've no time to fight with the tools.

If someone has a working recipe for all this madness, please
share a patch for d/rules.

Tagging with "help" for now.


Could you please share a branch or a patch with your attempt? What you
tried should work, but it's hard to say without looking at the
implementation in details.


Sure thing, it is in current busybox master on salsa, here:

https://salsa.debian.org/installer-team/busybox/-/blob/master/debian/rules#L172

with udhcpd.service & udhcpd.init in the same dir.

Thanks,

/mjt



Bug#1039142: busybox: ships sysv-init script without systemd unit

2023-11-14 Thread Luca Boccassi
On Mon, 13 Nov 2023 18:42:09 +0300 Michael Tokarev 
wrote:
> Control: tag -1 + help
> 
> On Sun, 25 Jun 2023 23:20:24 +0100 bl...@debian.org wrote:
> > Package: busybox
> > Severity: important
> > User: bl...@debian.org
> > Usertags: missing-systemd-service
> > 
> > Dear Maintainer(s),
> > 
> > busybox has been flagged by Lintian as shipping a sysv-init script
> > without a corresponding systemd unit file. The default init system
in
> > Debian is systemd, and so far this worked because a transitional
> > sysv-init-to-unit generator was shipped by systemd. This is in the
> > process of being deprecated and will be removed by the time Trixie
> > ships, so the remaining packages that ship init scripts without
> > systemd units will stop working.
> > 
> > There are various advantages to using native units, for example the
> > legacy generator cannot tell the different between a oneshot
service
> > and a long running daemon. Also, sanboxing and security features
> > become available for services. For more information, consult the
> > systemd documentation:
> > https://www.freedesktop.org/software/systemd/man/systemd.unit.html
> > 
> > You can find the Lintian warning here:
> > 
> > https://lintian.debian.org/sources/busybox
> 
> This site can't be found.  But it's ok.

Yeah things around Lintian publishing have changed since these bugs
have been filed

> So in current state, only udhcpd lacks systemd file.  So I tried to
> provide one.  The initscript for udhcpd checks for
UDHCPD_ENABLED=yes/no
> in /etc/default/udhcpd and does nothing if it is not enabled, which
> is the default.  Since there's no way in systemd to check for that
> (well, there is, with ExecConditional, but it ugly at best), I
thought
> to ship udhcpd.service not enabled by default.  Except it doesn't
> work.
> 
> With just dh_installsystemd --no-enable, it is still started.
> With dh_installsystemd --no-enable --no-start, it is started
> as well, - apparently because initscript is started.  Also,
> with --no-enable --no-start, it is not restarted on upgrades
> if enabled locally.
> 
> After doing several iterations, I decided to abandon this attempt, -
> it just does not work, and I've no time to fight with the tools.
> 
> If someone has a working recipe for all this madness, please
> share a patch for d/rules.
> 
> Tagging with "help" for now.

Could you please share a branch or a patch with your attempt? What you
tried should work, but it's hard to say without looking at the
implementation in details.

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#1039142: busybox: ships sysv-init script without systemd unit

2023-11-13 Thread Michael Tokarev

Control: tag -1 + help

On Sun, 25 Jun 2023 23:20:24 +0100 bl...@debian.org wrote:

Package: busybox
Severity: important
User: bl...@debian.org
Usertags: missing-systemd-service

Dear Maintainer(s),

busybox has been flagged by Lintian as shipping a sysv-init script
without a corresponding systemd unit file. The default init system in
Debian is systemd, and so far this worked because a transitional
sysv-init-to-unit generator was shipped by systemd. This is in the
process of being deprecated and will be removed by the time Trixie
ships, so the remaining packages that ship init scripts without
systemd units will stop working.

There are various advantages to using native units, for example the
legacy generator cannot tell the different between a oneshot service
and a long running daemon. Also, sanboxing and security features
become available for services. For more information, consult the
systemd documentation:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html

You can find the Lintian warning here:

https://lintian.debian.org/sources/busybox


This site can't be found.  But it's ok.

So in current state, only udhcpd lacks systemd file.  So I tried to
provide one.  The initscript for udhcpd checks for UDHCPD_ENABLED=yes/no
in /etc/default/udhcpd and does nothing if it is not enabled, which
is the default.  Since there's no way in systemd to check for that
(well, there is, with ExecConditional, but it ugly at best), I thought
to ship udhcpd.service not enabled by default.  Except it doesn't
work.

With just dh_installsystemd --no-enable, it is still started.
With dh_installsystemd --no-enable --no-start, it is started
as well, - apparently because initscript is started.  Also,
with --no-enable --no-start, it is not restarted on upgrades
if enabled locally.

After doing several iterations, I decided to abandon this attempt, -
it just does not work, and I've no time to fight with the tools.

If someone has a working recipe for all this madness, please
share a patch for d/rules.

Tagging with "help" for now.

Thanks,

/mjt