Fix remaining failing mtce services on Debian

Modified mtce to address the following
failing services on Debian:
crashDumpMgr.service
fsmon.service
goenabled.service
hostw.service
hwclock.service
mtcClient.service
pmon.service

Applied fix:
- Included modified .service files for debian
directly into into the deb_folder.
- Changed the init files to account for the different
locations of the init-functions and service daemons
on Debian and CentOS
- Included "override_dh_installsystemd" section
to rules in order to start services at boot.

Test Plan:

PASS: Package installed and ISO built successfully
PASS: Ran "systemctl list-units --failed" and verified that the
services are not failing
PASS: Ran "systemctl status <service_name>" for
each service and verified that they are behaving as desired
PASS: Services work as expected on CentOS
PASS: Bootstrap and host-unlock successful on CentOS

Story: 2009101
Task: 44323

Signed-off-by: Matheus Machado Guilhermino <Matheus.MachadoGuilhermino@windriver.com>
Change-Id: Ie61cedac24f84baea80cab6a69772f8b2e9e1395
This commit is contained in:
Matheus Machado Guilhermino 2022-01-19 14:58:59 -03:00
parent 4c8abe18d3
commit 360a344370
15 changed files with 188 additions and 24 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=Crash Dump Manager
After=network.target
Before=sshd.service
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/etc/init.d/crashDumpMgr --max-size 5Gi
[Install]
WantedBy=multi-user.target

View File

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

View File

@ -0,0 +1,13 @@
[Unit]
Description=StarlingX Maintenance Goenable Ready
After=config.service
Before=pmon.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/init.d/goenabled start
ExecStop=/etc/init.d/goenabled stop
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,23 @@
[Unit]
Description=StarlingX Maintenance Host Watchdog
After=syslog.service network.target hbsClient.service mtcClient.service sm.service fsmon.service
[Service]
Type=forking
ExecStart=/etc/init.d/hostw start
ExecStop=/etc/init.d/hostw stop
ExecReload=/etc/init.d/hostw reload
PIDFile=/var/run/hostwd.pid
# Failure handling
TimeoutStartSec=10s
TimeoutStopSec=10s
# Auto recovery
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,22 @@
[Unit]
Description=StarlingX Maintenance Command Handler Client
After=network.target syslog.service config.service
Before=pmon.service
[Service]
Type=forking
ExecStart=/etc/init.d/mtcClient start
ExecStop=/etc/init.d/mtcClient stop
ExecReload=/etc/init.d/mtcClient reload
PIDFile=/var/run/mtcClient.pid
KillMode=process
SendSIGKILL=no
# Process recovery is handled by pmond if its running.
# Delay 10 seconds to give pmond a chance to recover
# before systemd kicks in to do it as a backup plan.
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,4 @@
etc/init.d/hostw
etc/logrotate.d/hostw.logrotate
etc/mtc/hostwd.conf
lib/systemd/system/hostw.service
usr/bin/hostwd

View File

@ -1,7 +1,6 @@
etc/init.d/pmon
etc/logrotate.d/pmon.logrotate
etc/mtc/pmond.conf
lib/systemd/system/pmon.service
usr/bin/pmond
usr/lib/libamon.so
usr/lib/libamon.so.1

View File

@ -31,10 +31,6 @@ etc/services.d/controller/mtcTest
etc/services.d/storage/mtcTest
etc/services.d/worker/mtcTest
etc/syslog-ng/conf.d/mtce.conf
lib/systemd/system/crashDumpMgr.service
lib/systemd/system/fsmon.service
lib/systemd/system/goenabled.service
lib/systemd/system/mtcClient.service
usr/lib/ocf/resource.d/platform/mtcAgent
usr/bin/fsmond
usr/bin/hbsAgent

View File

@ -0,0 +1,25 @@
[Unit]
Description=StarlingX Maintenance Process Monitor
After=config.service
# The following thirdparty service files are not modified by StarlingX,
# so add "After" clauses here rather than "Before=pmon.service" to those
After=sshd.service acpid.service syslog-ng.service
After=ntpd.service ptp4l.service phc2sys.service
Before=hostw.service
[Service]
Type=forking
ExecStart=/etc/init.d/pmon start
ExecStop=/etc/init.d/pmon stop
ExecReload=/etc/init.d/pmon reload
PIDFile=/var/run/pmond.pid
KillMode=process
# Failure handling
TimeoutStartSec=10s
TimeoutStopSec=10s
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target

View File

@ -88,15 +88,6 @@ override_dh_auto_install:
install -m 755 -p -D scripts/hwclock.sh $(MTCESHAREDIR)/hwclock.sh
install -m 644 -p -D scripts/hwclock.service $(MTCESHAREDIR)/hwclock.service
# systemd service files
install -m 755 -d $(UNITDIR)
install -m 644 -p -D fsmon/scripts/fsmon.service $(UNITDIR)/fsmon.service
install -m 644 -p -D pmon/scripts/pmon.service $(UNITDIR)/pmon.service
install -m 644 -p -D hostw/scripts/hostw.service $(UNITDIR)/hostw.service
install -m 644 -p -D scripts/crashDumpMgr.service $(UNITDIR)/crashDumpMgr.service
install -m 644 -p -D scripts/mtcClient.service $(UNITDIR)/mtcClient.service
install -m 644 -p -D scripts/goenabled.service $(UNITDIR)/goenabled.service
# go enabled script
install -m 755 -p -D scripts/goenabled $(INITDIR)/goenabled
@ -157,11 +148,18 @@ override_dh_auto_install:
install -m 755 -d $(ROOT)/var/run
override_dh_installsystemd:
dh_installsystemd --name crashDumpMgr
dh_installsystemd --name fsmon
dh_installsystemd --name goenabled
dh_installsystemd --name hbsClient
dh_installsystemd --name hostw
dh_installsystemd --name hwclock
dh_installsystemd --name hwmon
dh_installsystemd --name lmon
dh_installsystemd --name mtcalarm
dh_installsystemd --name mtcClient
dh_installsystemd --name mtclog
dh_installsystemd --name pmon
dh_installsystemd --name runservices
override_dh_usrlocal:

View File

@ -17,10 +17,22 @@
# Short-Description: fsmon daemon
### END INIT INFO
. /etc/init.d/functions
CENTOS_FUNCTIONS="/etc/init.d/functions"
DEBIAN_FUNCTIONS="/lib/lsb/init-functions"
if [ ! -f ${CENTOS_FUNCTIONS} ] ; then
. ${DEBIAN_FUNCTIONS}
else
. ${CENTOS_FUNCTIONS}
fi
DAEMON_NAME="fsmond"
DAEMON="/usr/local/bin/${DAEMON_NAME}"
DAEMON_CENTOS_PATH="/usr/local/bin/${DAEMON_NAME}"
DAEMON_DEBIAN_PATH="/usr/bin/${DAEMON_NAME}"
if [ ! -f ${DAEMON_CENTOS_PATH} ] ; then
DAEMON=${DAEMON_DEBIAN_PATH}
else
DAEMON=${DAEMON_CENTOS_PATH}
fi
PIDFILE="/var/run/${DAEMON_NAME}.pid"
# Linux Standard Base (LSB) Error Codes

View File

@ -19,10 +19,22 @@
# echo "7:3:respawn:/usr/local/bin/hostwd" >> /etc/inittab
. /etc/init.d/functions
CENTOS_FUNCTIONS="/etc/init.d/functions"
DEBIAN_FUNCTIONS="/lib/lsb/init-functions"
if [ ! -f ${CENTOS_FUNCTIONS} ] ; then
. ${DEBIAN_FUNCTIONS}
else
. ${CENTOS_FUNCTIONS}
fi
DAEMON_NAME="hostwd"
DAEMON="/usr/local/bin/${DAEMON_NAME}"
DAEMON_CENTOS_PATH="/usr/local/bin/${DAEMON_NAME}"
DAEMON_DEBIAN_PATH="/usr/bin/${DAEMON_NAME}"
if [ ! -f ${DAEMON_CENTOS_PATH} ] ; then
DAEMON=${DAEMON_DEBIAN_PATH}
else
DAEMON=${DAEMON_CENTOS_PATH}
fi
IFACE=""
if [ ! -e "$DAEMON" ] ; then

View File

@ -19,10 +19,22 @@
# echo "7:3:respawn:/usr/local/bin/pmond" >> /etc/inittab
. /etc/init.d/functions
CENTOS_FUNCTIONS="/etc/init.d/functions"
DEBIAN_FUNCTIONS="/lib/lsb/init-functions"
if [ ! -f ${CENTOS_FUNCTIONS} ] ; then
. ${DEBIAN_FUNCTIONS}
else
. ${CENTOS_FUNCTIONS}
fi
DAEMON_NAME="pmond"
DAEMON="/usr/local/bin/${DAEMON_NAME}"
DAEMON_CENTOS_PATH="/usr/local/bin/${DAEMON_NAME}"
DAEMON_DEBIAN_PATH="/usr/bin/${DAEMON_NAME}"
if [ ! -f ${DAEMON_CENTOS_PATH} ] ; then
DAEMON=${DAEMON_DEBIAN_PATH}
else
DAEMON=${DAEMON_CENTOS_PATH}
fi
IFACE=""
if [ ! -e "$DAEMON" ] ; then

View File

@ -21,7 +21,13 @@
# in /etc/default/rcS, or in the proper place below.
# Source function library.
. /etc/init.d/functions
CENTOS_FUNCTIONS="/etc/init.d/functions"
DEBIAN_FUNCTIONS="/lib/lsb/init-functions"
if [ ! -f ${CENTOS_FUNCTIONS} ] ; then
. ${DEBIAN_FUNCTIONS}
else
. ${CENTOS_FUNCTIONS}
fi
[ ! -x /sbin/hwclock ] && exit 0

View File

@ -17,10 +17,22 @@
# Short-Description: Maintenance Client Daemon
### END INIT INFO
. /etc/init.d/functions
CENTOS_FUNCTIONS="/etc/init.d/functions"
DEBIAN_FUNCTIONS="/lib/lsb/init-functions"
if [ ! -f ${CENTOS_FUNCTIONS} ] ; then
. ${DEBIAN_FUNCTIONS}
else
. ${CENTOS_FUNCTIONS}
fi
DAEMON_NAME="mtcClient"
DAEMON="/usr/local/bin/${DAEMON_NAME}"
DAEMON_CENTOS_PATH="/usr/local/bin/${DAEMON_NAME}"
DAEMON_DEBIAN_PATH="/usr/bin/${DAEMON_NAME}"
if [ ! -f ${DAEMON_CENTOS_PATH} ] ; then
DAEMON=${DAEMON_DEBIAN_PATH}
else
DAEMON=${DAEMON_CENTOS_PATH}
fi
PIDFILE="/var/run/${DAEMON_NAME}.pid"
PLATFORM_CONF="/etc/platform/platform.conf"