From b918cd2934d94a7c5afe88ba4c3de964a54368c2 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Fri, 24 Apr 2020 15:27:30 +0800 Subject: [PATCH] stx-metal: inherit systemd to enable services - inherit systemd bbclass and set correct variables to enable services. - remove sysvinit from DISTRO_FEATURES_BACKFILL_CONSIDERED to avoid init scripts being removed. - remove the useless pkg_postinst functions - move lmon.service to mtce-lmon Issue-ID: INF-28 Issue-ID: INF-29 Signed-off-by: Jackie Huang Change-Id: Id17ce7b5536686ab180c0714c9355143adcc3d8d --- meta-stx/recipes-core/stx-metal/mtce-compute.inc | 8 ++--- meta-stx/recipes-core/stx-metal/mtce-control.inc | 4 +++ meta-stx/recipes-core/stx-metal/mtce-storage.inc | 4 +++ meta-stx/recipes-core/stx-metal/mtce.inc | 38 +++++++++++++++--------- meta-stx/recipes-core/stx-metal/stx-metal.bb | 4 ++- 5 files changed, 39 insertions(+), 19 deletions(-) diff --git a/meta-stx/recipes-core/stx-metal/mtce-compute.inc b/meta-stx/recipes-core/stx-metal/mtce-compute.inc index 3c0aea7..ac0326c 100644 --- a/meta-stx/recipes-core/stx-metal/mtce-compute.inc +++ b/meta-stx/recipes-core/stx-metal/mtce-compute.inc @@ -36,13 +36,13 @@ do_install_prepend () { install } -#pkg_postinst_ontarget_mtce-compute() { -# /usr/bin/systemctl enable goenabled-worker.service -#} - FILES_mtce-compute = " \ ${datadir}/licenses/mtce-compute-1.0/LICENSE \ ${systemd_system_unitdir}/goenabled-worker.service \ ${sysconfdir}/goenabled.d/virt-support-goenabled.sh \ ${sysconfdir}/init.d/goenabledWorker \ " + +SYSTEMD_PACKAGES += "mtce-compute" +SYSTEMD_SERVICE_mtce-compute = "goenabled-worker.service" +SYSTEMD_AUTO_ENABLE_mtce-compute = "enable" diff --git a/meta-stx/recipes-core/stx-metal/mtce-control.inc b/meta-stx/recipes-core/stx-metal/mtce-control.inc index fe18a68..3d0f241 100644 --- a/meta-stx/recipes-core/stx-metal/mtce-control.inc +++ b/meta-stx/recipes-core/stx-metal/mtce-control.inc @@ -51,3 +51,7 @@ FILES_mtce-control = " \ ${sysconfdir}/init.d/hbsAgent \ ${sysconfdir}/init.d/goenabledControl \ " + +SYSTEMD_PACKAGES += "mtce-control" +SYSTEMD_SERVICE_mtce-control = "hbsAgent.service" +SYSTEMD_AUTO_ENABLE_mtce-control = "enable" diff --git a/meta-stx/recipes-core/stx-metal/mtce-storage.inc b/meta-stx/recipes-core/stx-metal/mtce-storage.inc index f1aeb49..61fb97f 100644 --- a/meta-stx/recipes-core/stx-metal/mtce-storage.inc +++ b/meta-stx/recipes-core/stx-metal/mtce-storage.inc @@ -45,3 +45,7 @@ FILES_mtce-storage = " \ ${systemd_system_unitdir}/goenabled-storage.service \ ${sysconfdir}/init.d/goenabledStorage \ " + +SYSTEMD_PACKAGES += "mtce-storage" +SYSTEMD_SERVICE_mtce-storage = "goenabled-storage.service" +SYSTEMD_AUTO_ENABLE_mtce-storage = "enable" diff --git a/meta-stx/recipes-core/stx-metal/mtce.inc b/meta-stx/recipes-core/stx-metal/mtce.inc index e2d4358..bcc426a 100644 --- a/meta-stx/recipes-core/stx-metal/mtce.inc +++ b/meta-stx/recipes-core/stx-metal/mtce.inc @@ -190,19 +190,29 @@ do_install_prepend () { #cd ${D}/%{_libdir} ; ln -s libamon.so.$MAJOR libamon.so } -#pkg_postinst_ontarget-mtce () { -# /usr/bin/systemctl enable hbsClient.service -# /usr/bin/systemctl enable mtcalarm.service -# /usr/bin/systemctl enable mtclog.service -# /usr/bin/systemctl enable mtcClient.service -# /usr/bin/systemctl enable goenabled.service -# /usr/bin/systemctl enable lmon.service -# /usr/bin/systemctl enable hostw.service -# /usr/bin/systemctl enable fsmon.service -# /usr/bin/systemctl enable pmon.service -# # /usr/bin/systemctl enable hwclock.service -# # /usr/bin/systemctl enable runservices.service -#} +SYSTEMD_PACKAGES += " \ + mtce \ + mtce-hostw \ + mtce-lmon \ + mtce-pmon \ + " + +SYSTEMD_SERVICE_mtce = " \ + fsmon.service \ + goenabled.service \ + hbsClient.service \ + mtcClient.service \ + mtcalarm.service \ + mtclog.service \ + " +SYSTEMD_SERVICE_mtce-hostw = "hostw.service" +SYSTEMD_SERVICE_mtce-lmon = "lmon.service" +SYSTEMD_SERVICE_mtce-pmon = "pmon.service" + +SYSTEMD_AUTO_ENABLE_mtce = "enable" +SYSTEMD_AUTO_ENABLE_mtce-hostw = "enable" +SYSTEMD_AUTO_ENABLE_mtce-lmon = "enable" +SYSTEMD_AUTO_ENABLE_mtce-pmon = "enable" FILES_mtce-pmon = " \ ${sbindir}/pmon-restart \ @@ -238,6 +248,7 @@ FILES_mtce-lmon= " \ ${sysconfdir}/logrotate.d/lmon.logrotate \ ${sysconfdir}/pmon.d/lmon.conf \ ${sysconfdir}/init.d/lmon \ + ${systemd_system_unitdir}/lmon.service \ " FILES_mtce = " \ @@ -261,7 +272,6 @@ FILES_mtce = " \ ${systemd_system_unitdir}/hbsClient.service \ ${systemd_system_unitdir}/hwclock.service \ ${systemd_system_unitdir}/runservices.service \ - ${systemd_system_unitdir}/lmon.service \ ${sysconfdir}/pmon.d/nslcd.conf \ ${sysconfdir}/pmon.d/mtclogd.conf \ ${sysconfdir}/pmon.d/mtcalarm.conf \ diff --git a/meta-stx/recipes-core/stx-metal/stx-metal.bb b/meta-stx/recipes-core/stx-metal/stx-metal.bb index b3b9029..7122565 100644 --- a/meta-stx/recipes-core/stx-metal/stx-metal.bb +++ b/meta-stx/recipes-core/stx-metal/stx-metal.bb @@ -47,7 +47,7 @@ SRC_URI = "git://opendev.org/starlingx/metal.git;protocol=${PROTOCOL};rev=${SRCR file://stx-warrior-adjust-paths.patch \ " -inherit setuptools +inherit setuptools systemd DEPENDS = " \ @@ -90,3 +90,5 @@ FILES_${PN} = " " FILES_${PN}-dbg_append += " " FILES_${PN}-staticdev_append = " " FILES_${PN}-dev_append = " " + +DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit" -- 2.16.6