Debian: Fix mtce-guest services on Debian

Modified mtce-guest to address the following failing services on Debian:
guestAgent.service
guestServer.service
(the service provides a means of guest heartbeat
orchestration under VIM (system management) control)

Applied fix:
- Included modified .service files for debian directly into
the deb_folder.
- Included "override_dh_installsystemd" section to rules in order
to start guestServer at boot and guestAgent with --no-enable option
- Removed guestAgent.service and guestServer.service install from
Makefile to spec, in order to override (for CentOS build)
- Modified service scripts to fork for Daemon location
- Move binaries to usr/local/bin

PASS: Package installed and ISO built on Debian successfully
PASS: Services are running correctly after loading the image:
guestServer is started automatically, guestAgent (--no-enable) runs
correctly when started via systemctl
PASS: guestServer runs as expected after bootstrap

PASS: Package installed and ISO built on CentOS successfully
PASS: Services are running on CentOS after bootstrap and
unlock correctly

Story: 2009101
Task: 44323


Change-Id: I856fcc78c41953ae37e7c2cf1361b4466b15720b
This commit is contained in:
Andrei Suciu 2022-02-23 11:28:56 +00:00 committed by Al Bailey
parent cb69ac6590
commit 987d5b9b77
7 changed files with 52 additions and 9 deletions

View File

@ -127,6 +127,9 @@ make install \
LOCALBINDIR=%{buildroot}%{local_bindir} \ LOCALBINDIR=%{buildroot}%{local_bindir} \
UNITDIR=%{buildroot}%{_unitdir} UNITDIR=%{buildroot}%{_unitdir}
install -m 644 -p -D scripts/guestServer.service %{buildroot}%{_unitdir}/guestServer.service
install -m 644 -p -D scripts/guestAgent.service %{buildroot}%{_unitdir}/guestAgent.service
# enable all services in systemd # enable all services in systemd
%post -n mtce-guestServer %post -n mtce-guestServer
/bin/systemctl enable guestServer.service /bin/systemctl enable guestServer.service

View File

@ -0,0 +1,16 @@
[Unit]
Description=StarlingX Guest Agent
After=network.target syslog.service
[Service]
Type=forking
ExecStart=/etc/init.d/guestAgent start
ExecStop=/etc/init.d/guestAgent stop
ExecReload=/etc/init.d/guestAgent reload
PIDFile=/var/run/guestAgent.pid
Restart=no
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,23 @@
[Unit]
Description=StarlingX Maintenance Guest Heartbeat Monitor Server
After=network.target syslog.service config.service
Before=pmon.service
[Service]
Type=forking
ExecStart=/etc/init.d/guestServer start
ExecStop=/etc/init.d/guestServer stop
ExecReload=/etc/init.d/guestServer reload
PIDFile=/var/run/guestServer.pid
# Failure handling
TimeoutStartSec=10s
TimeoutStopSec=10s
# process recovery is handled by pmond
Restart=no
RestartSec=5
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +1,5 @@
usr/bin/guestAgent usr/local/bin/guestAgent
usr/lib/ocf/resource.d/platform/guestAgent usr/lib/ocf/resource.d/platform/guestAgent
lib/systemd/system/guestAgent.service
etc/init.d/guestAgent etc/init.d/guestAgent
etc/logrotate.d/guestAgent.logrotate etc/logrotate.d/guestAgent.logrotate
etc/mtc/guestAgent.ini etc/mtc/guestAgent.ini

View File

@ -1,5 +1,4 @@
usr/bin/guestServer usr/local/bin/guestServer
lib/systemd/system/guestServer.service
etc/init.d/guestServer etc/init.d/guestServer
etc/logrotate.d/guestServer.logrotate etc/logrotate.d/guestServer.logrotate
etc/mtc/guestServer.ini etc/mtc/guestServer.ini

View File

@ -3,7 +3,7 @@
export ROOT=debian/tmp export ROOT=debian/tmp
export BINDIR=/usr/bin export BINDIR=/usr/local/bin
export INITDIR=$(ROOT)/etc/init.d export INITDIR=$(ROOT)/etc/init.d
export LOGDIR=$(ROOT)/etc/logrotate.d export LOGDIR=$(ROOT)/etc/logrotate.d
export MTCDIR=$(ROOT)/etc/mtc export MTCDIR=$(ROOT)/etc/mtc
@ -33,5 +33,12 @@ override_dh_auto_install:
install -d -m 755 $(PMONDIR) install -d -m 755 $(PMONDIR)
install -p -D -m 644 scripts/guestServer.pmon $(PMONDIR)/guestServer.conf install -p -D -m 644 scripts/guestServer.pmon $(PMONDIR)/guestServer.conf
override_dh_installsystemd:
dh_installsystemd --name guestServer
dh_installsystemd --no-enable --name guestAgent
override_dh_fixperms: override_dh_fixperms:
dh_fixperms -XguestAgent -XguestServer dh_fixperms -XguestAgent -XguestServer
override_dh_usrlocal:
echo "SKIPPING DH USRLOCAL"

View File

@ -63,10 +63,6 @@ install:
install -m 700 -p -D scripts/guestServer $(SYSCONFDIR)/init.d/guestServer install -m 700 -p -D scripts/guestServer $(SYSCONFDIR)/init.d/guestServer
install -m 700 -p -D scripts/guestAgent $(SYSCONFDIR)/init.d/guestAgent install -m 700 -p -D scripts/guestAgent $(SYSCONFDIR)/init.d/guestAgent
# systemd service files
install -m 644 -p -D scripts/guestServer.service $(UNITDIR)/guestServer.service
install -m 644 -p -D scripts/guestAgent.service $(UNITDIR)/guestAgent.service
# process monitor config files # process monitor config files
install -m 755 -d $(SYSCONFDIR)/pmon.d install -m 755 -d $(SYSCONFDIR)/pmon.d
install -m 644 -p -D scripts/guestServer.pmon $(SYSCONFDIR)/pmon.d/guestServer.conf install -m 644 -p -D scripts/guestServer.pmon $(SYSCONFDIR)/pmon.d/guestServer.conf