Re: [meta-virtualization][PATCH] libvirt: fix postinstall scriptlets failure

2024-02-22 Thread Bruce Ashfield
Thanks for the follow up, it is now dropped!

Bruce

On Wed, Feb 21, 2024 at 2:42 AM Xiangyu Chen
 wrote:
>
> Hi Bruce,
>
>
> As the comment mentioned,  this issue root cause is service A ...
> service N enable each other caused oe-core's systemctl trap into a dead
> loop. To simply revert a commit in libvirt is masking the truth, other
> package might meet this issue,  so a fix using a filter in systemctl to
> against duplicates has been sent to oe-core mail
> list(https://lists.openembedded.org/g/openembedded-core/message/195958).
>
>
> So please ignore this patch and help to remove it from
> meta-virtualization master-next (commit:
> 79c82358f322983e101e238695a9a77f56a675ab)
>
>
> Thanks  :)
>
>
> Br,
>
> Xiangyu
>
> On 2/6/24 19:11, Xiangyu Chen wrote:
> > From: Xiangyu Chen 
> >
> > libvirt upstream has added all sockets for a service being enabled when a
> > single one of them is[1], it likes serviceA enable serviceB, serviceB enable
> > serviceA, that cause our systemctl script[2] 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
> >
> > Since we are using systemctl script to process the dependency, so revert 
> > that
> > commit from upstream.
> >
> > [1] 
> > https://github.com/libvirt/libvirt/commit/826931e95a38af8322f8ad069dc89117c6404a00
> > [2] 
> > https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd-systemctl/systemctl
> >
> > Signed-off-by: Xiangyu Chen 
> > ---
> >   ...ert-systemd-Add-Also-between-sockets.patch | 143 ++
> >   recipes-extended/libvirt/libvirt_10.0.0.bb|   1 +
> >   2 files changed, 144 insertions(+)
> >   create mode 100644 
> > recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
> >
> > diff --git 
> > a/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
> >  
> > b/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
> > new file mode 100644
> > index ..84367fc3
> > --- /dev/null
> > +++ 
> > b/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
> > @@ -0,0 +1,143 @@
> > +From 66aa101abb639c64f71a2867424fb58a39a3bd21 Mon Sep 17 00:00:00 2001
> > +From: Xiangyu Chen 
> > +Date: Tue, 6 Feb 2024 18:45:53 +0800
> > +Subject: [PATCH] Revert "systemd: Add Also between sockets"
> > +
> > +This reverts commit 826931e95a38af8322f8ad069dc89117c6404a00.
> > +
> > +We have systemctl script to process the service dependency, this cause our 
> > oe-core systemctl script
> > +trap into a dead loop.
> > +
> > +Error 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
> > +
> > +Upstream-Status: Inappropriate [oe specific]
> > +
> > +Signed-off-by: Xiangyu Chen 
> > +---
> > + src/locking/virtlockd-admin.socket.in | 1 -
> > + src/locking/virtlockd.socket.in   | 1 -
> > + src/logging/virtlogd-admin.socket.in  | 1 -
> > + src/logging/virtlogd.socket.in| 1 -
> > + src/remote/libvirtd-admin.socket.in   | 2 --
> > + src/remote/libvirtd-ro.socket.in  | 2 --
> > + src/remote/libvirtd.socket.in | 2 --
> > + src/virtd-admin.socket.in | 2 --
> > + src/virtd-ro.socket.in| 2 --
> > + src/virtd.socket.in   | 2 --
> > + 10 files changed, 16 deletions(-)
> > +
> > +diff --git a/src/locking/virtlockd-admin.socket.in 
> > b/src/locking/virtlockd-admin.socket.in
> > +index 

Re: [meta-virtualization][PATCH] libvirt: fix postinstall scriptlets failure

2024-02-20 Thread Xiangyu Chen

Hi Bruce,


As the comment mentioned,  this issue root cause is service A ... 
service N enable each other caused oe-core's systemctl trap into a dead 
loop. To simply revert a commit in libvirt is masking the truth, other 
package might meet this issue,  so a fix using a filter in systemctl to 
against duplicates has been sent to oe-core mail 
list(https://lists.openembedded.org/g/openembedded-core/message/195958).



So please ignore this patch and help to remove it from 
meta-virtualization master-next (commit: 
79c82358f322983e101e238695a9a77f56a675ab)



Thanks  :)


Br,

Xiangyu

On 2/6/24 19:11, Xiangyu Chen wrote:

From: Xiangyu Chen 

libvirt upstream has added all sockets for a service being enabled when a
single one of them is[1], it likes serviceA enable serviceB, serviceB enable
serviceA, that cause our systemctl script[2] 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

Since we are using systemctl script to process the dependency, so revert that
commit from upstream.

[1] 
https://github.com/libvirt/libvirt/commit/826931e95a38af8322f8ad069dc89117c6404a00
[2] 
https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd-systemctl/systemctl

Signed-off-by: Xiangyu Chen 
---
  ...ert-systemd-Add-Also-between-sockets.patch | 143 ++
  recipes-extended/libvirt/libvirt_10.0.0.bb|   1 +
  2 files changed, 144 insertions(+)
  create mode 100644 
recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch

diff --git 
a/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
 
b/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
new file mode 100644
index ..84367fc3
--- /dev/null
+++ 
b/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
@@ -0,0 +1,143 @@
+From 66aa101abb639c64f71a2867424fb58a39a3bd21 Mon Sep 17 00:00:00 2001
+From: Xiangyu Chen 
+Date: Tue, 6 Feb 2024 18:45:53 +0800
+Subject: [PATCH] Revert "systemd: Add Also between sockets"
+
+This reverts commit 826931e95a38af8322f8ad069dc89117c6404a00.
+
+We have systemctl script to process the service dependency, this cause our 
oe-core systemctl script
+trap into a dead loop.
+
+Error 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
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Xiangyu Chen 
+---
+ src/locking/virtlockd-admin.socket.in | 1 -
+ src/locking/virtlockd.socket.in   | 1 -
+ src/logging/virtlogd-admin.socket.in  | 1 -
+ src/logging/virtlogd.socket.in| 1 -
+ src/remote/libvirtd-admin.socket.in   | 2 --
+ src/remote/libvirtd-ro.socket.in  | 2 --
+ src/remote/libvirtd.socket.in | 2 --
+ src/virtd-admin.socket.in | 2 --
+ src/virtd-ro.socket.in| 2 --
+ src/virtd.socket.in   | 2 --
+ 10 files changed, 16 deletions(-)
+
+diff --git a/src/locking/virtlockd-admin.socket.in 
b/src/locking/virtlockd-admin.socket.in
+index ed5b94edba..8902ae4225 100644
+--- a/src/locking/virtlockd-admin.socket.in
 b/src/locking/virtlockd-admin.socket.in
+@@ -11,4 +11,3 @@ RemoveOnStop=yes
+
+ [Install]
+ WantedBy=sockets.target
+-Also=virtlockd.socket
+diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket.in
+index 4eec90a95e..afd42d124e 100644
+--- a/src/locking/virtlockd.socket.in
 b/src/locking/virtlockd.socket.in
+@@ -9,4 +9,3 @@ RemoveOnStop=yes
+
+ [Install]
+ WantedBy=sockets.target
+-Also=virtlockd-admin.socket
+diff --git