From feb258db57484322afd85d8f0f2e5d864f9e2c3a Mon Sep 17 00:00:00 2001 From: Hediberto Cavalcante da Silva Date: Wed, 5 Oct 2022 12:56:07 -0400 Subject: [PATCH] Debian: Reorganize storage config package This work: - is part of Debian integration effort. - affect Debian only - will allow puppet manifests to be applied on storage node at unlock/reboot time. This specific commit: - allows controllerconfig, workerconfig-standalone and storageconfig packages to coexist on the same iso by letting files be selected at runtime - lets storageconfig service be installed by systemd Test Plan on Debian: PASS: controllers unlocked on AIO-SX, AIO-DX, Standard & Storage PASS: workers unlocked on Standard & Storage PASS: storages unlocked on Storage PASS: storageconfig started puppet manifest apply on storage nodes PASS: controllerconfig is running on controller node on AIO-SX, AIO-DX, Standard & Storage PASS: workerconfig is not running on controller and storage nodes on AIO-SX, AIO-DX, Standard & Storage PASS: storageconfig is not running on controller and worker nodes on AIO-SX, AIO-DX, Standard & Storage PASS: workerconfig is running on worker node Standard & Storage Depends-On: https://review.opendev.org/c/starlingx/metal/+/860495 Story: 2010211 Task: 46506 Signed-off-by: Hediberto Cavalcante da Silva Change-Id: I83dde1cf406217e483f05f5504659930612edf70 --- debian_iso_image.inc | 2 +- storageconfig/debian/deb_folder/rules | 15 +++++++++------ .../debian/deb_folder/storageconfig.dirs | 1 - .../debian/deb_folder/storageconfig.install | 3 +-- .../deb_folder}/storageconfig.service | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) rename storageconfig/{storageconfig => debian/deb_folder}/storageconfig.service (85%) diff --git a/debian_iso_image.inc b/debian_iso_image.inc index 60fef7ae9b..e961057c05 100644 --- a/debian_iso_image.inc +++ b/debian_iso_image.inc @@ -5,7 +5,7 @@ cert-mon cgts-client config-gate controllerconfig -#storageconfig +storageconfig sysinv sysinv-agent workerconfig-standalone diff --git a/storageconfig/debian/deb_folder/rules b/storageconfig/debian/deb_folder/rules index d7693720f5..ff5ca6be70 100755 --- a/storageconfig/debian/deb_folder/rules +++ b/storageconfig/debian/deb_folder/rules @@ -1,20 +1,23 @@ #!/usr/bin/make -f #export DH_VERBOSE=1 -PKGDIR=$(CURDIR)/debian/tmp +PKGDIR := $(CURDIR)/debian/tmp export INITDDIR=$(PKGDIR)/etc/init.d export GOENABLEDDIR=$(PKGDIR)/etc/goenabled.d -export SYSTEMDDIR=$(PKGDIR)/lib/systemd/system %: dh $@ override_dh_auto_build: - : # nothing to be built, just skip + : # No build required -override_dh_fixperms: - dh_fixperms -Xstorage_config +override_dh_auto_install: + install -d -m 755 ${INITDDIR} + install -p -D -m 700 storage_config ${INITDDIR}/storage_config + install -d -m 755 ${GOENABLEDDIR} + install -p -D -m 700 config_goenabled_check.sh ${GOENABLEDDIR}/config_goenabled_check.sh.storage override_dh_installsystemd: - dh_installsystemd --name storageconfig + dh_installsystemd -pstorageconfig --name=storageconfig --no-start storageconfig.service + diff --git a/storageconfig/debian/deb_folder/storageconfig.dirs b/storageconfig/debian/deb_folder/storageconfig.dirs index 1ef23fd167..c31836c743 100644 --- a/storageconfig/debian/deb_folder/storageconfig.dirs +++ b/storageconfig/debian/deb_folder/storageconfig.dirs @@ -1,3 +1,2 @@ etc/init.d etc/goenabled.d -lib/systemd/system/config diff --git a/storageconfig/debian/deb_folder/storageconfig.install b/storageconfig/debian/deb_folder/storageconfig.install index 331a44d3a5..1f485bb57e 100644 --- a/storageconfig/debian/deb_folder/storageconfig.install +++ b/storageconfig/debian/deb_folder/storageconfig.install @@ -1,3 +1,2 @@ etc/init.d/storage_config -etc/goenabled.d/config_goenabled_check.sh -lib/systemd/system/storageconfig.service +etc/goenabled.d/* diff --git a/storageconfig/storageconfig/storageconfig.service b/storageconfig/debian/deb_folder/storageconfig.service similarity index 85% rename from storageconfig/storageconfig/storageconfig.service rename to storageconfig/debian/deb_folder/storageconfig.service index b98f88b4d4..134e8901de 100644 --- a/storageconfig/storageconfig/storageconfig.service +++ b/storageconfig/debian/deb_folder/storageconfig.service @@ -10,8 +10,8 @@ Type=simple ExecStart=/etc/init.d/storage_config start ExecStop= ExecReload= -StandardOutput=syslog+console -StandardError=syslog+console +StandardOutput=journal+console +StandardError=journal+console RemainAfterExit=yes [Install]