* [PATCH 0/1] systemd: mark /etc as updated to avoid unnecessary services to run
@ 2019-09-25 3:07 Chen Qi
2019-09-25 3:07 ` [PATCH 1/1] " Chen Qi
0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2019-09-25 3:07 UTC (permalink / raw)
To: openembedded-core
*** BLURB HERE ***
The following changes since commit 81f9e815d36848761a9dfa94b00ad998bb39a4a6:
build-appliance-image: Update to master head revision (2019-09-19 20:32:53 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/etc-updated
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/etc-updated
Chen Qi (1):
systemd: mark /etc as updated to avoid unnecessary services to run
meta/classes/rootfs-postcommands.bbclass | 6 ++++++
meta/recipes-core/systemd/systemd_243.bb | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] systemd: mark /etc as updated to avoid unnecessary services to run
2019-09-25 3:07 [PATCH 0/1] systemd: mark /etc as updated to avoid unnecessary services to run Chen Qi
@ 2019-09-25 3:07 ` Chen Qi
2019-09-25 9:43 ` Ross Burton
0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2019-09-25 3:07 UTC (permalink / raw)
To: openembedded-core
We have updated hwdb via postinstall, updated systemd users via
'systemd_create_users', so there's no need to update /etc. Mark it
as updated to avoid unnecessary services like systemd-hwdb-update.service
to run.
This would solve timeout problem on qemumips. So also remove the
timeout change for systemd-hwdb-update.service.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/classes/rootfs-postcommands.bbclass | 6 ++++++
meta/recipes-core/systemd/systemd_243.bb | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 88f75d0..9323e92 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -36,6 +36,8 @@ POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
# Set default target for systemd images
SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; systemd_create_users;", "", d)}'
+# Mark /etc as updated for systemd as we have done things in rootfs time
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd_mark_etc_updated;", "", d)}'
ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
@@ -86,6 +88,10 @@ systemd_create_users () {
done
}
+systemd_mark_etc_updated () {
+ touch ${IMAGE_ROOTFS}${sysconfdir}/.updated
+}
+
#
# A hook function to support read-only-rootfs IMAGE_FEATURES
#
diff --git a/meta/recipes-core/systemd/systemd_243.bb b/meta/recipes-core/systemd/systemd_243.bb
index f0e8c56..0148c37 100644
--- a/meta/recipes-core/systemd/systemd_243.bb
+++ b/meta/recipes-core/systemd/systemd_243.bb
@@ -298,12 +298,6 @@ do_install() {
install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
}
-do_install_append () {
- # Mips qemu is extremely slow, allow more time for the hwdb update
- # This is a workaround until https://github.com/systemd/systemd/issues/13581 is resolved
- sed -i -e s#TimeoutSec=90s#TimeoutSec=180s# ${D}${systemd_unitdir}/system/systemd-hwdb-update.service
-}
-
python populate_packages_prepend (){
systemdlibdir = d.getVar("rootlibdir")
do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] systemd: mark /etc as updated to avoid unnecessary services to run
2019-09-25 3:07 ` [PATCH 1/1] " Chen Qi
@ 2019-09-25 9:43 ` Ross Burton
0 siblings, 0 replies; 3+ messages in thread
From: Ross Burton @ 2019-09-25 9:43 UTC (permalink / raw)
To: openembedded-core
On 25/09/2019 04:07, Chen Qi wrote:
> We have updated hwdb via postinstall, updated systemd users via
> 'systemd_create_users', so there's no need to update /etc. Mark it
> as updated to avoid unnecessary services like systemd-hwdb-update.service
> to run.
>
> This would solve timeout problem on qemumips. So also remove the
> timeout change for systemd-hwdb-update.service.
I was going to send almost this exact patch, *but* I don't think it's right.
Arbitrary service files can use ConditionNeedsUpdate, and marking /etc
as updated because we don't want hwdb-update to run also means we don't
execute ldconfig.service, systemd-sysusers.server, or any other service
files that were added and expected to be ran on first boot.
Some other distributions rip out systemd-hwdb-update entirely and use
traditional postinsts to handle it:
Debian:
https://salsa.debian.org/systemd-team/systemd/blob/master/debian/rules#L221
Clear:
https://github.com/clearlinux-pkgs/systemd/blob/master/systemd.spec#L419
I believe that we should do the same.
Ross
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-25 9:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-25 3:07 [PATCH 0/1] systemd: mark /etc as updated to avoid unnecessary services to run Chen Qi
2019-09-25 3:07 ` [PATCH 1/1] " Chen Qi
2019-09-25 9:43 ` Ross Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox