Devuan bug report logs - #723
init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion

Package: systemctl-service-shim; Maintainer for systemctl-service-shim is B. Stack <bgstack15@gmail.com>; Source for systemctl-service-shim is src:systemctl-service-shim.

Reported by: wolfgang@leila.ping.de (Wolfgang Wegner)

Date: Sun, 13 Nov 2022 18:08:01 UTC

Severity: normal

Tags: moreinfo

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to devuan-bugs@lists.dyne.org, wolfgang@leila.ping.de, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Sun, 13 Nov 2022 18:08:01 GMT) (full text, mbox, link).


Acknowledgement sent to wolfgang@leila.ping.de (Wolfgang Wegner):
New bug report received and forwarded. Copy sent to wolfgang@leila.ping.de, Devuan Dev Team <devuan-dev@lists.dyne.org>. (Sun, 13 Nov 2022 18:08:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.devuan.org (full text, mbox, reply):

From: wolfgang@leila.ping.de (Wolfgang Wegner)
To: submit@bugs.devuan.org
Subject: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Sat, 12 Nov 2022 21:20:17 +0100
Package: init-system-helpers
Version: 1.65.2devuan1
Severity: normal
X-Debbugs-Cc: wolfgang@leila.ping.de

Dear Maintainer,

I am trying to install a package which expects SystemD. I manually added
scripts and an initial set for sysVinit. However, the post-install script
calls "systemctl --no-reload enable <packagename>", which invokes
update-rc.d, which in turn diverts to a systemctl call, and so on.

Calling update-rc.d from the systemctl "abstraction" (surrogate?) seems
to be correct, but I would have expected update-rc.d to detect the system's
init system and - as I am using sysVinit on Devuan - just modify the links.

update-rc.d behaviour can also be reproduced when calling it for an already
installed service.

-- System Information:
Distributor ID: Devuan
Description:    Devuan GNU/Linux 5 (daedalus/ceres)
Release:        5
Codename:       daedalus ceres
Architecture: x86_64

Kernel: Linux 5.19.9-wolfgang-wolfgang (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages init-system-helpers is related to:
ii  insserv  1.24.0-1

-- no debconf information

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Sun, 13 Nov 2022 18:40:02 GMT) (full text, mbox, link).


Message #8 received at 723@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: Wolfgang Wegner <wolfgang@leila.ping.de>, 723@bugs.devuan.org
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Sun, 13 Nov 2022 18:38:28 +0000
Control: tags -1 moreinfo

Wolfgang,

Thanks for this.

On Sat, Nov 12, 2022 at 09:20:17PM +0100, Wolfgang Wegner wrote:
> Package: init-system-helpers
> Version: 1.65.2devuan1
> Severity: normal
> X-Debbugs-Cc: wolfgang@leila.ping.de
> 
> Dear Maintainer,
> 
> I am trying to install a package which expects SystemD. I manually added
> scripts and an initial set for sysVinit. However, the post-install script
> calls "systemctl --no-reload enable <packagename>", which invokes
> update-rc.d, which in turn diverts to a systemctl call, and so on.

Which of the available systemctl emulations do you have installed?

> Calling update-rc.d from the systemctl "abstraction" (surrogate?) seems
> to be correct, but I would have expected update-rc.d to detect the system's
> init system and - as I am using sysVinit on Devuan - just modify the links.
> 
> update-rc.d behaviour can also be reproduced when calling it for an already
> installed service.

Could you give a specific example here. I can't reproduce it.

Thanks

Mark

Added tag(s) moreinfo. Request was from Mark Hindley <mark@hindley.org.uk> to 723-submit@bugs.devuan.org. (Sun, 13 Nov 2022 18:40:07 GMT) (full text, mbox, link).


Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Sun, 13 Nov 2022 21:04:01 GMT) (full text, mbox, link).


Acknowledgement sent to wolfgang@leila.ping.de (Wolfgang Wegner):
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Sun, 13 Nov 2022 21:04:03 GMT) (full text, mbox, link).


Message #15 received at 723@bugs.devuan.org (full text, mbox, reply):

From: wolfgang@leila.ping.de (Wolfgang Wegner)
To: Mark Hindley <mark@hindley.org.uk>
Cc: 723@bugs.devuan.org
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Sun, 13 Nov 2022 22:00:05 +0100
Hi Mark,

thanks for looking into this!

On Sun, Nov 13, 2022 at 06:38:28PM +0000, Mark Hindley wrote:
> Control: tags -1 moreinfo
> 
> Wolfgang,
> 
> Thanks for this.
> 
> On Sat, Nov 12, 2022 at 09:20:17PM +0100, Wolfgang Wegner wrote:
> > Package: init-system-helpers
> > Version: 1.65.2devuan1
> > Severity: normal
> > X-Debbugs-Cc: wolfgang@leila.ping.de
> > 
> > Dear Maintainer,
> > 
> > I am trying to install a package which expects SystemD. I manually added
> > scripts and an initial set for sysVinit. However, the post-install script
> > calls "systemctl --no-reload enable <packagename>", which invokes
> > update-rc.d, which in turn diverts to a systemctl call, and so on.
> 
> Which of the available systemctl emulations do you have installed?

Sorry I am not sure what exactly you mean here. I try to list packages that
might be relevant:

ii  init-system-helpers          1.65.2devuan1 all          helper tools for all init systems
ii  initscripts                  3.05-6devuan1 all          scripts for initializing and shutting down the system
ii  orphan-sysvinit-scripts      0.11          all          Orphaned System-V-like init scripts
ii  sysvinit                     3.05-6devuan1 amd64        System-V-like init utilities - transitional package
ii  sysvinit-core                3.05-6devuan1 amd64        System-V-like init
ii  sysvinit-utils               3.05-6devuan1 amd64        System-V-like utilities
ii  systemctl-service-shim 0.0.4-1      all          Adds systemctl translator script
ii  dummy-systemd-dev   0.2          all          Development files extracted from systemd

"systemctl-service-shim" might be what you are asking for, but I did not see
any alternative?

> > Calling update-rc.d from the systemctl "abstraction" (surrogate?) seems
> > to be correct, but I would have expected update-rc.d to detect the system's
> > init system and - as I am using sysVinit on Devuan - just modify the links.
> > 
> > update-rc.d behaviour can also be reproduced when calling it for an already
> > installed service.
> 
> Could you give a specific example here. I can't reproduce it.

root@<host>:~# update-rc.d rsyslog enable
update-rc.d rsyslog enable
update-rc.d rsyslog enable
update-rc.d rsyslog enable
...

> Thanks
> 
> Mark

Best regards
Wolfgang

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Mon, 14 Nov 2022 10:26:01 GMT) (full text, mbox, link).


Acknowledgement sent to Mark Hindley <mark@hindley.org.uk>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 14 Nov 2022 10:26:03 GMT) (full text, mbox, link).


Message #20 received at 723@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: Wolfgang Wegner <wolfgang@leila.ping.de>
Cc: 723@bugs.devuan.org
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Mon, 14 Nov 2022 10:24:39 +0000
Wolfgang,

On Sun, Nov 13, 2022 at 10:00:05PM +0100, Wolfgang Wegner wrote:
> > > I am trying to install a package which expects SystemD. I manually added
> > > scripts and an initial set for sysVinit. However, the post-install script
> > > calls "systemctl --no-reload enable <packagename>", which invokes
> > > update-rc.d, which in turn diverts to a systemctl call, and so on.
> > 
> > Which of the available systemctl emulations do you have installed?
> 
> Sorry I am not sure what exactly you mean here. I try to list packages that
> might be relevant:
> 
> ii  init-system-helpers          1.65.2devuan1 all          helper tools for all init systems
> ii  initscripts                  3.05-6devuan1 all          scripts for initializing and shutting down the system
> ii  orphan-sysvinit-scripts      0.11          all          Orphaned System-V-like init scripts
> ii  sysvinit                     3.05-6devuan1 amd64        System-V-like init utilities - transitional package
> ii  sysvinit-core                3.05-6devuan1 amd64        System-V-like init
> ii  sysvinit-utils               3.05-6devuan1 amd64        System-V-like utilities
> ii  systemctl-service-shim 0.0.4-1      all          Adds systemctl translator script
> ii  dummy-systemd-dev   0.2          all          Development files extracted from systemd
> 
> "systemctl-service-shim" might be what you are asking for, but I did not see
> any alternative?

Yes, that what what I meant. There is also a Debian systemctl package, but it is
not really maintained and I wouldn't recommend it.

I notice you have dummy-systemd-dev installed. You really don't want that on a
production system. If is a hack for building sources that Build-Dep: systemd. It
doesn't provide any systemd functionality.

If you remove it does it make any difference?

> > > Calling update-rc.d from the systemctl "abstraction" (surrogate?) seems
> > > to be correct, but I would have expected update-rc.d to detect the system's
> > > init system and - as I am using sysVinit on Devuan - just modify the links.
> > > 
> > > update-rc.d behaviour can also be reproduced when calling it for an already
> > > installed service.
> > 
> > Could you give a specific example here. I can't reproduce it.
> 
> root@<host>:~# update-rc.d rsyslog enable
> update-rc.d rsyslog enable
> update-rc.d rsyslog enable
> update-rc.d rsyslog enable

Hmmm, I get completely different behaviour with that command:-

mark@apollo:~% sudo update-rc.d enable rsyslog
usage: update-rc.d [-f] <basename> remove
       update-rc.d [-f] <basename> defaults
       update-rc.d [-f] <basename> defaults-disabled
       update-rc.d <basename> disable|enable [S|2|3|4|5]
                -f: force

The disable|enable API is not stable and might change in the future.

What systemd-requiring package are you trying to install? What other changes
have you made?

Mark

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Mon, 14 Nov 2022 10:54:02 GMT) (full text, mbox, link).


Acknowledgement sent to wolfgang@leila.ping.de (Wolfgang Wegner):
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 14 Nov 2022 10:54:03 GMT) (full text, mbox, link).


Message #25 received at 723@bugs.devuan.org (full text, mbox, reply):

From: wolfgang@leila.ping.de (Wolfgang Wegner)
To: Mark Hindley <mark@hindley.org.uk>
Cc: 723@bugs.devuan.org
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Mon, 14 Nov 2022 11:51:17 +0100
On Mon, Nov 14, 2022 at 10:24:39AM +0000, Mark Hindley wrote:
[...]
> I notice you have dummy-systemd-dev installed. You really don't want that on a
> production system. If is a hack for building sources that Build-Dep: systemd. It
> doesn't provide any systemd functionality.
> 
> If you remove it does it make any difference?

Thanks - I removed it now, but that does not make any difference.

> > > > Calling update-rc.d from the systemctl "abstraction" (surrogate?) seems
> > > > to be correct, but I would have expected update-rc.d to detect the system's
> > > > init system and - as I am using sysVinit on Devuan - just modify the links.
> > > > 
> > > > update-rc.d behaviour can also be reproduced when calling it for an already
> > > > installed service.
> > > 
> > > Could you give a specific example here. I can't reproduce it.
> > 
> > root@<host>:~# update-rc.d rsyslog enable
> > update-rc.d rsyslog enable
> > update-rc.d rsyslog enable
> > update-rc.d rsyslog enable
> 
> Hmmm, I get completely different behaviour with that command:-
> 
> mark@apollo:~% sudo update-rc.d enable rsyslog

Is the switched basename/command pair intended here?

> usage: update-rc.d [-f] <basename> remove
>        update-rc.d [-f] <basename> defaults
>        update-rc.d [-f] <basename> defaults-disabled
>        update-rc.d <basename> disable|enable [S|2|3|4|5]
>                 -f: force
> 
> The disable|enable API is not stable and might change in the future.
> 
> What systemd-requiring package are you trying to install? What other changes
> have you made?

The package I try to install is *cough* "cybereason-sensor", which is now
required to install from our IT department. Their post-install script
relies on either upstart or systemd being present. As in consequence, no
LSB init script is provided with the package, I created a basic one and
also added the standard links in /etc/rc?.d/.

I am not aware of other changes I did to the system - however, the
installation is originating from a Devuan 1.0 install and has only been
updated to the current state, which has been quite cumbersome with respect
to some in-between incompatibilities, especially the usual NVIDIA mess
but also some things concerning qemu/KVM and wine.
(This is to say: I do not remember any changes in the area of the init
system but there has been some fiddling around trying to get some updates
installed.)

As another test, I just tried to remove systemctl-service-shim, and
immediately the weird behaviour of update-rc.d is gone:

root@<host>:~# dpkg -r systemctl-service-shim
(Reading database ... 836967 files and directories currently installed.)
Removing systemctl-service-shim (0.0.4-1) ...
Processing triggers for man-db (2.11.0-1+b1) ...
root@<host>:~# update-rc.d rsyslog enable
root@<host>:~#

So to me it really looks like an unwanted interaction just between
update-rc.d and systemctl-service-shim.

> Mark

Best regards
Wolfgang

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Mon, 14 Nov 2022 10:56:01 GMT) (full text, mbox, link).


Acknowledgement sent to Mark Hindley <mark@hindley.org.uk>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 14 Nov 2022 10:56:02 GMT) (full text, mbox, link).


Message #30 received at 723@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: 723@bugs.devuan.org, 732-sumbitter@bugs.devuan.org, bgstack15@gmail.com
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Mon, 14 Nov 2022 10:53:24 +0000
Antony,

On Mon, Nov 14, 2022 at 11:31:39AM +0100, Where all about bugs in Devuan packages is reported wrote:
> > Hmmm, I get completely different behaviour with that command:-
> > 
> > mark@apollo:~% sudo update-rc.d enable rsyslog
> > usage: update-rc.d [-f] <basename> remove
> >        update-rc.d [-f] <basename> defaults
> >        update-rc.d [-f] <basename> defaults-disabled
> >        update-rc.d <basename> disable|enable [S|2|3|4|5]
> >                 -f: force
> 
> Um, "update-rc.d rsyslog enable" != "update-rc.d enable rsyslog".

Thanks for pointing out my obvious (but not to me!) mistake.

So I can now reproduce this, but only if systemctl-service-shim is installed. If
it is removed, update-rc.d behaves as expected.

[Adding bgstack15]

Is this an issue in the way systemctl-service-shim behaves? I don't see it with
systemctl on a Debian sysvinit system.

Thanks.

Mark

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Mon, 14 Nov 2022 12:52:01 GMT) (full text, mbox, link).


Acknowledgement sent to B Stack <bgstack15@gmail.com>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 14 Nov 2022 12:52:03 GMT) (full text, mbox, link).


Message #35 received at 723@bugs.devuan.org (full text, mbox, reply):

From: B Stack <bgstack15@gmail.com>
To: Mark Hindley <mark@hindley.org.uk>
Cc: 723@bugs.devuan.org, 732-sumbitter@bugs.devuan.org
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Mon, 14 Nov 2022 07:50:26 -0500
Hi,

The systemctl-service-shim main script /usr/bin/systemctl also has a
symlink at /bin/systemctl. If the script is called from /bin/systemctl
then it will remove this symlink during operations to avoid the
recursive calls like you see happening here. You can check the
relevant logs at /var/log/systemctl.log, and please share them here.

The systemctl service shim script has a known problem particularly on
the "enable" action [0] that I thought was fixed. The logs, if you can
share them, might help make an improvement such as the script getting
called in a particular way where it also needs to remove the symlink
to prevent infinite recursion.

B. Stack
[0]: https://bugs.devuan.org/cgi/bugreport.cgi?bug=688

On Mon, Nov 14, 2022 at 5:53 AM Mark Hindley <mark@hindley.org.uk> wrote:
>
> Antony,
>
> On Mon, Nov 14, 2022 at 11:31:39AM +0100, Where all about bugs in Devuan packages is reported wrote:
> > > Hmmm, I get completely different behaviour with that command:-
> > >
> > > mark@apollo:~% sudo update-rc.d enable rsyslog
> > > usage: update-rc.d [-f] <basename> remove
> > >        update-rc.d [-f] <basename> defaults
> > >        update-rc.d [-f] <basename> defaults-disabled
> > >        update-rc.d <basename> disable|enable [S|2|3|4|5]
> > >                 -f: force
> >
> > Um, "update-rc.d rsyslog enable" != "update-rc.d enable rsyslog".
>
> Thanks for pointing out my obvious (but not to me!) mistake.
>
> So I can now reproduce this, but only if systemctl-service-shim is installed. If
> it is removed, update-rc.d behaves as expected.
>
> [Adding bgstack15]
>
> Is this an issue in the way systemctl-service-shim behaves? I don't see it with
> systemctl on a Debian sysvinit system.
>
> Thanks.
>
> Mark

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#723; Package init-system-helpers. (Mon, 14 Nov 2022 16:38:02 GMT) (full text, mbox, link).


Acknowledgement sent to Mark Hindley <mark@hindley.org.uk>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 14 Nov 2022 16:38:04 GMT) (full text, mbox, link).


Message #40 received at 723@bugs.devuan.org (full text, mbox, reply):

From: Mark Hindley <mark@hindley.org.uk>
To: B Stack <bgstack15@gmail.com>
Cc: 723@bugs.devuan.org, 732-sumbitter@bugs.devuan.org
Subject: Re: bug#723: init-system-helpers: update-rc.d calls systemctl on a SysVinit system, creating a recursion
Date: Mon, 14 Nov 2022 16:34:55 +0000
Control: reassign -1 systemctl-service-shim

Ben,

Thanks

Reassigning.

Mark

bug reassigned from package 'init-system-helpers' to 'systemctl-service-shim'. Request was from Mark Hindley <mark@hindley.org.uk> to 723-submit@bugs.devuan.org. (Mon, 14 Nov 2022 16:38:07 GMT) (full text, mbox, link).


No longer marked as found in versions 1.65.2devuan1. Request was from Mark Hindley <mark@hindley.org.uk> to 723-submit@bugs.devuan.org. (Mon, 14 Nov 2022 16:38:07 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Wed Apr 24 19:29:04 2024;