* [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded
@ 2021-03-22 12:00 Awais Belal
2021-03-23 12:21 ` [OE-core] " Oleksiy Obitotskyy
0 siblings, 1 reply; 3+ messages in thread
From: Awais Belal @ 2021-03-22 12:00 UTC (permalink / raw)
To: openembedded-core
The service is unnecessarily run even when it is unneeded.
This was handled correctly for sysV systems however the
service still runs on the systemd systems as it is not
disabled/masked when not needed.
Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
meta/lib/oe/rootfs.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 249c685dcf..fe35ce5b70 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -257,6 +257,10 @@ class Rootfs(object, metaclass=ABCMeta):
self._exec_shell_cmd(["update-rc.d", "-f", "-r",
self.d.getVar('IMAGE_ROOTFS'),
"run-postinsts", "remove"])
+ if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${systemd_unitdir}/system/run-postinsts.service")):
+ self._exec_shell_cmd(["systemctl",
+ "--root", self.d.getVar('IMAGE_ROOTFS'),
+ "mask", "run-postinsts.service"])
image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
True, False, self.d)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded
2021-03-22 12:00 [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded Awais Belal
@ 2021-03-23 12:21 ` Oleksiy Obitotskyy
2021-03-25 12:10 ` Awais Belal
0 siblings, 1 reply; 3+ messages in thread
From: Oleksiy Obitotskyy @ 2021-03-23 12:21 UTC (permalink / raw)
To: Awais Belal, openembedded-core
Could you please look into logs.
Seems that path cause failures.
https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/2114/steps/13/logs/stdio
***********************
Central error: 2021-03-23T02:03:58+0000 ERROR Error in POSTIN scriptlet in rpm package run-postinsts
***********************
+ systemctl
+ OPTS=
+ '[' -n '' ']'
+ '[' enable = enable ']'
+ for service in run-postinsts.service
+ systemctl enable run-postinsts.service
Failed to enable unit: Unit file /etc/systemd/system/run-postinsts.service is masked.
%post(run-postinsts-1.0-r10.noarch): waitpid(11256) rc 11256 status 100
warning: %post(run-postinsts-1.0-r10.noarch) scriptlet failed, exit status 1
Regards,
Oleksiy
________________________________________
From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> on behalf of Awais Belal <Awais_Belal@mentor.com>
Sent: Monday, March 22, 2021 14:00
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded
The service is unnecessarily run even when it is unneeded.
This was handled correctly for sysV systems however the
service still runs on the systemd systems as it is not
disabled/masked when not needed.
Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
meta/lib/oe/rootfs.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 249c685dcf..fe35ce5b70 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -257,6 +257,10 @@ class Rootfs(object, metaclass=ABCMeta):
self._exec_shell_cmd(["update-rc.d", "-f", "-r",
self.d.getVar('IMAGE_ROOTFS'),
"run-postinsts", "remove"])
+ if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${systemd_unitdir}/system/run-postinsts.service")):
+ self._exec_shell_cmd(["systemctl",
+ "--root", self.d.getVar('IMAGE_ROOTFS'),
+ "mask", "run-postinsts.service"])
image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
True, False, self.d)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded
2021-03-23 12:21 ` [OE-core] " Oleksiy Obitotskyy
@ 2021-03-25 12:10 ` Awais Belal
0 siblings, 0 replies; 3+ messages in thread
From: Awais Belal @ 2021-03-25 12:10 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
Hi Oleksiy,
I've submitted https://lists.openembedded.org/g/openembedded-core/topic/81600237 which should supersede this I did not send it as v3 because it is a different solution. I've also ran 'bitbake -c testimage core-image-sato' with the new solution and it is passing.
[-- Attachment #2: Type: text/html, Size: 407 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-25 12:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 12:00 [PATCH v2] rootfs.py: mask run-postinsts systemd service when unneeded Awais Belal
2021-03-23 12:21 ` [OE-core] " Oleksiy Obitotskyy
2021-03-25 12:10 ` Awais Belal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.