From c9a80e6b5ffaf053a511f763fb703a58662d14cb Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Mon, 7 Mar 2022 13:55:29 +0000 Subject: [PATCH] debian: Fix service-mgmt-api packaging issues - Removed unneeded dependencies. - Install systemd services in the correct directory. - Enabled systemd preset so that the packaging is starting correctly when the server boots. Test Plan PASS Build and test ISO. PASS Check sm service has started. Story: 2009101 Task: 44678 Depends-On: https://review.opendev.org/c/starlingx/integ/+/831950 Signed-off-by: Chuck Short Change-Id: I05f7f559f14892eaede069930398359b3d26f6e5 --- service-mgmt-api/debian/deb_folder/control | 4 +--- service-mgmt-api/debian/deb_folder/rules | 7 +++++-- service-mgmt-api/debian/deb_folder/sm-api.dirs | 2 -- service-mgmt-api/debian/deb_folder/sm-api.install | 6 ++++-- .../debian/deb_folder/systemd/00-sm-api.preset | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 service-mgmt-api/debian/deb_folder/systemd/00-sm-api.preset diff --git a/service-mgmt-api/debian/deb_folder/control b/service-mgmt-api/debian/deb_folder/control index 21f0f7c2..ed93a0e8 100644 --- a/service-mgmt-api/debian/deb_folder/control +++ b/service-mgmt-api/debian/deb_folder/control @@ -7,7 +7,6 @@ Build-Depends: debhelper-compat (= 13), python3-all, python3-setuptools, python3-wheel, - libsystemd-dev Build-Depends-Indep: python3-eventlet, python3-httplib2, @@ -29,9 +28,8 @@ Rules-Requires-Root: no Package: sm-api Architecture: all -Depends: python3:any, ${python3:Depends}, ${misc:Depends}, +Depends: ${python3:Depends}, ${misc:Depends}, python3-six, - systemd, mtce-pmon, python3-eventlet, python3-httplib2, diff --git a/service-mgmt-api/debian/deb_folder/rules b/service-mgmt-api/debian/deb_folder/rules index 0751c7b5..9c20701e 100755 --- a/service-mgmt-api/debian/deb_folder/rules +++ b/service-mgmt-api/debian/deb_folder/rules @@ -22,13 +22,16 @@ override_dh_install: install -d $(ROOT)/etc/sm install -d $(ROOT)/etc/init.d install -d $(ROOT)/etc/pmon.d - install -d $(ROOT)/usr/lib/systemd/system/ + install -d $(ROOT)/lib/systemd/system/ install -m 644 -p -D scripts/sm_api.ini $(ROOT)/etc/sm install -m 755 -p -D scripts/sm-api $(ROOT)/etc/init.d - install -m 644 -p -D scripts/sm-api.service $(ROOT)/usr/lib/systemd/system/ + install -m 644 -p -D scripts/sm-api.service $(ROOT)/lib/systemd/system/ install -m 644 -p -D scripts/sm-api.conf $(ROOT)/etc/pmon.d dh_install override_dh_python3: dh_python3 --shebang=/usr/bin/python3 + +override_dh_installsystemd: + dh_installsystemd -psm-api sm-api.service diff --git a/service-mgmt-api/debian/deb_folder/sm-api.dirs b/service-mgmt-api/debian/deb_folder/sm-api.dirs index 261519ad..5fd40004 100644 --- a/service-mgmt-api/debian/deb_folder/sm-api.dirs +++ b/service-mgmt-api/debian/deb_folder/sm-api.dirs @@ -1,3 +1 @@ etc/sm -usr/lib/python3/dist-packages/sm_api -usr/lib/python3/dist-packages/sm_api-1.0.0.egg-info diff --git a/service-mgmt-api/debian/deb_folder/sm-api.install b/service-mgmt-api/debian/deb_folder/sm-api.install index f49c9e40..2f5f7410 100644 --- a/service-mgmt-api/debian/deb_folder/sm-api.install +++ b/service-mgmt-api/debian/deb_folder/sm-api.install @@ -3,5 +3,7 @@ usr/bin/sm-api etc/init.d/sm-api etc/pmon.d/sm-api.conf etc/sm/sm_api.ini -usr/lib/systemd/system/* -usr/lib/python*/dist-packages/* +lib/systemd/system/* +usr/lib/python3* +debian/systemd/00-sm-api.preset etc/systemd/system-preset + diff --git a/service-mgmt-api/debian/deb_folder/systemd/00-sm-api.preset b/service-mgmt-api/debian/deb_folder/systemd/00-sm-api.preset new file mode 100644 index 00000000..8ffa1354 --- /dev/null +++ b/service-mgmt-api/debian/deb_folder/systemd/00-sm-api.preset @@ -0,0 +1 @@ +enable sm-api.service