]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
systemd-systemctl: fix dead loop when multi services enable each other
authorXiangyu Chen <xiangyu.chen@windriver.com>
Wed, 21 Feb 2024 07:29:42 +0000 (15:29 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Feb 2024 22:18:17 +0000 (22:18 +0000)
commit4c45f975310184a773b25b8e7d7ef50fba2f7bd6
treecbce517bcbfde44b1683148a8d6e513e4e48e670
parentda381fb3d9dcd0e66bc3b48bdfde95cd29f0c654
systemd-systemctl: fix dead loop when multi services enable each other

libvirt has added a feature that all sockets for a service being enabled when a single
one of them is enabled since 9.9.x[1], it likes serviceA enable serviceB, serviceB enable
serviceA, that cause our systemctl script trap into a dead loop in postinstall stage,
the error message as below:

Traceback (most recent call last):
  File "/usr/lib/python3.8/pathlib.py", line 722, in __str__
    return self._str
AttributeError: _str

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
    SystemdUnit(self.root, also).enable(unit)
  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
    SystemdUnit(self.root, also).enable(unit)
  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
    SystemdUnit(self.root, also).enable(unit)
  [Previous line repeated 988 more times]
......
RecursionError: maximum recursion depth exceeded while calling a Python object

Here using an array to record the services which has been enabled to filter the duplicates.

Ref:
[1] https://github.com/libvirt/libvirt/commit/826931e95a38af8322f8ad069dc89117c6404a00

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd-systemctl/systemctl