Subject: bug#687: python3-ipalib scripts contain calls to /bin/systemctl

From: Jernej Jakob <[email-masked]>
Date: Thu, 7 Jul 2022 16:42:14 +0200

On Thu, 7 Jul 2022 08:28:56 -0400
B Stack <[email-masked]> wrote:

> I maintain a package [1] in Ceres that provides a shell script that handles
> the "systemctl" calls. I use python3-ipalib on my Devuan Ceres installs
> with this dependency and it operates just fine. If you have a patch for
> switching the embedded hardcoded invocations to service/update-rc.d
> commands, I would be happy to review it!
> 
> B. Stack
> 
> [1]:
> https://pkginfo.devuan.org/cgi-bin/package-query.html?c=package&q=systemctl-service-shim=0.0.2-1

Thanks, that's great, if it can be done without patching files in the
package. But I already have systemctl-service-shim installed, it is a
dependency of python3-ipalib. But it only provides /usr/sbin/systemctl,
not /bin/systemctl, which is where python3-ipalib expects it to be.
If I create a symlink there, ipa-client-install appears to go further,
but then hangs at:

2022-07-07T14:22:15Z DEBUG Backing up '/etc/chrony/chrony.conf'
2022-07-07T14:22:15Z DEBUG Backing up system configuration file '/etc/chrony/chrony.conf'
2022-07-07T14:22:15Z DEBUG Saving Index File to '/var/lib/ipa-client/sysrestore/sysrestore.index'
2022-07-07T14:22:15Z DEBUG Writing configuration to '/etc/chrony/chrony.conf'
2022-07-07T14:22:15Z ERROR Augeas failed to configure file /etc/chrony/chrony.conf
2022-07-07T14:22:15Z DEBUG Starting external process
2022-07-07T14:22:15Z DEBUG args=['/usr/sbin/selinuxenabled']
2022-07-07T14:22:15Z DEBUG Process execution failed
2022-07-07T14:22:15Z DEBUG Starting external process
2022-07-07T14:22:15Z DEBUG args=['/bin/systemctl', 'enable', 'chrony.service']
2022-07-07T14:25:45Z DEBUG Process interrupted

The systemctl enable process was hung for 3 minutes before I
interrupted with ctrl-C.

If I run it by hand, I see this infinite loop:

~# /bin/systemctl enable chrony.service
update-rc.d chrony enable
insserv: warning: script 'cgroups' missing LSB tags
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cgroups'
insserv: Default-Stop  undefined, assuming empty stop runlevel(s) for script `cgroups'
 * rc-update: chrony already installed in runlevel `default'; skipping
update-rc.d chrony enable
insserv: warning: script 'cgroups' missing LSB tags
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cgroups'
insserv: Default-Stop  undefined, assuming empty stop runlevel(s) for script `cgroups'
 * rc-update: chrony already installed in runlevel `default'; skipping
update-rc.d chrony enable

and so on until I press ctrl-C.

So I think this is a bug in systemctl-service-shim ?