Fix failing sysinv services on Debian

Modified sysinv to address the following failing
services on Debian:

sysinv-agent.service
sysinv-api.service
sysinv-conductor.service
sysinv-conf-watcher.service
sysinv-fpga-agent.service

Note: Sysinv services are dependent on platform.conf and
build.info files, currently, those are not available on
debian and should be addressed in the near future. They
were created manually in order to start the services.

Applied fix:
- Included modified .service files for debian
directly into into the deb_folder.
- Changed the script files to account for the different
locations of the init-functions.
- Included "override_dh_installsystemd" section
to rules in order to install services.
- Included --no-enable on sysinv-api, sysinv-conductor
to prevent failed state after install as is on centOS,
the services is started further on bootstrap.

Test Plan:

PASS: Package installed and ISO built successfully.
PASS: Services are on the expected state after iso install:
	sysinv-api, sysinv-conductor: loaded.
	sysinv-agent: active.
	sysinv-conf-watcher, sysinv-fpga-agent: failed.
PASS: Services are running after bootstrap on Debian.

Story: 2009101
Task: 44348

Depends-on: https://review.opendev.org/c/starlingx/integ/+/826935
Signed-off-by: lbonatti <LuizEduardo.Bonatti@windriver.com>
Change-Id: I87e05f2b05a39ff109a2ea18763d4aae9827a8c3
This commit is contained in:
lbonatti 2022-01-24 12:14:33 -03:00 committed by Luis Eduardo Bonatti
parent 211194beef
commit 6131a76447
13 changed files with 85 additions and 15 deletions

View File

@ -9,8 +9,10 @@ ROOT := $(CURDIR)/debian/tmp
override_dh_install:
install -p -D -m 755 sysinv-agent ${ROOT}/etc/init.d/sysinv-agent
install -p -D -m 644 sysinv-agent.conf ${ROOT}/etc/pmon.d/sysinv-agent.conf
install -p -D -m 644 sysinv-agent.service ${ROOT}/lib/systemd/system/sysinv-agent.service
dh_install
override_dh_installinit:
dh_installinit --only-scripts
override_dh_installsystemd:
dh_installsystemd --name sysinv-agent

View File

@ -1,3 +1,2 @@
etc/init.d/sysinv-agent
etc/pmon.d/sysinv-agent.conf
lib/systemd/system/sysinv-agent.service

View File

@ -0,0 +1,15 @@
[Unit]
Description=StarlingX System Inventory Agent
After=nfscommon.service sw-patch.service
After=network-online.target systemd-udev-settle.service
Before=pmon.service
[Service]
Type=forking
RemainAfterExit=yes
ExecStart=/etc/init.d/sysinv-agent start
ExecStop=/etc/init.d/sysinv-agent stop
PIDFile=/var/run/sysinv-agent.pid
[Install]
WantedBy=multi-user.target

View File

@ -14,7 +14,7 @@
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Stop: 0 1 6
# Short-Description: Maintenance daemon
# Short-Description: Maintenance daemon
### END INIT INFO
. /etc/init.d/functions

View File

@ -9,14 +9,12 @@ ROOT := $(CURDIR)/debian/tmp
override_dh_install:
install -p -D -m 755 sysinv-fpga-agent ${ROOT}/etc/init.d/sysinv-fpga-agent
install -p -D -m 644 sysinv-fpga-agent.conf ${ROOT}/etc/pmon.d/sysinv-fpga-agent.conf
install -p -D -m 644 sysinv-fpga-agent.service ${ROOT}/lib/systemd/system/sysinv-fpga-agent.service
install -p -D -m 644 sysinv-conf-watcher.service ${ROOT}/lib/systemd/system/sysinv-conf-watcher.service
install -p -D -m 644 sysinv-conf-watcher.path ${ROOT}/lib/systemd/system/sysinv-conf-watcher.path
dh_install
override_dh_usrlocal:
# do nothing
override_dh_installsystemd:
dh_installsystemd --name=sysinv-fpga-agent.service
dh_installsystemd --name=sysinv-fpga-watcher.service
dh_installsystemd --name sysinv-fpga-agent.service
dh_installsystemd --name sysinv-conf-watcher.service
dh_installsystemd --name sysinv-conf-watcher.path

View File

@ -0,0 +1,5 @@
[Path]
PathChanged=/etc/sysinv/sysinv.conf
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=StarlingX conf watcher
After=sysinv-fpga-agent.service
Before=pmon.service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart sysinv-fpga-agent.service
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,2 @@
etc/init.d/sysinv-fpga-agent
etc/pmon.d/sysinv-fpga-agent.conf
lib/systemd/system/sysinv-fpga-agent.service
lib/systemd/system/sysinv-conf-watcher.service
lib/systemd/system/sysinv-conf-watcher.path

View File

@ -0,0 +1,15 @@
[Unit]
Description=StarlingX FPGA Agent
After=nfscommon.service sw-patch.service
After=network-online.target systemd-udev-settle.service sysinv-agent.service
Before=pmon.service
[Service]
Type=forking
RemainAfterExit=yes
ExecStart=/etc/init.d/sysinv-fpga-agent start
ExecStop=/etc/init.d/sysinv-fpga-agent stop
PIDFile=/var/run/sysinv-fpga-agent.pid
[Install]
WantedBy=multi-user.target

View File

@ -27,8 +27,8 @@ override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
override_dh_installsystemd:
dh_installsystemd --name=sysinv-api
dh_installsystemd --name=sysinv-conductor
dh_installsystemd --no-enable --name sysinv-api
dh_installsystemd --no-enable --name sysinv-conductor
override_dh_fixperms:
dh_fixperms -Xkube-cert-rotation.sh

View File

@ -0,0 +1,15 @@
[Unit]
Description=System Inventory API
After=network-online.target syslog-ng.service config.service sysinv-conductor.service
[Service]
Type=simple
RemainAfterExit=yes
User=root
Environment=OCF_ROOT=/usr/lib/ocf
ExecStart=/usr/lib/ocf/resource.d/platform/sysinv-api start
ExecStop=/usr/lib/ocf/resource.d/platform/sysinv-api stop
PIDFile=/var/run/sysinv-api.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,15 @@
[Unit]
Description=System Inventory Conductor
After=network-online.target syslog-ng.service config.service rabbitmq-server.service
[Service]
Type=simple
RemainAfterExit=yes
User=root
Environment=OCF_ROOT=/usr/lib/ocf
ExecStart=/usr/lib/ocf/resource.d/platform/sysinv-conductor start
ExecStop=/usr/lib/ocf/resource.d/platform/sysinv-conductor stop
PIDFile=/var/run/sysinv-conductor.pid
[Install]
WantedBy=multi-user.target

View File

@ -6,8 +6,6 @@ etc/sysinv/crushmap-aio-sx.txt etc/sysinv
etc/sysinv/delete_load.sh etc/sysinv/upgrades
scripts/sysinv-api usr/lib/ocf/resource.d/platform
scripts/sysinv-conductor usr/lib/ocf/resource.d/platform
scripts/sysinv-api.service lib/systemd/system
scripts/sysinv-conductor.service lib/systemd/system
scripts/partition_info.sh usr/bin
scripts/validate-platform-backup.sh usr/bin
scripts/manage-partitions usr/bin