Allow pm-qos-mgr to restart if killed abnormally

The pm-qos-mgr process does not automatically restart if it is
killed/stopped abnormally.

Configuring pm-qos-mgr to be managed by pmon.

Change-Id: Ifb632d71d63dab6f6b1935880843870ba742f196
Depends-On: https://review.opendev.org/#/c/681550/
Partial-Bug: 1840356
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey
2019-09-11 13:07:48 -05:00
parent e32b790684
commit 01a06ea6e5
4 changed files with 17 additions and 1 deletions

View File

@@ -1,2 +1,2 @@
SRC_DIR="src"
TIS_PATCH_VER=1
TIS_PATCH_VER=2

View File

@@ -25,6 +25,7 @@ A daemon that monitors kubelet cpu-manager static cpu assignments
and modifies PM QoS CPU wakeup latency.
%define pythonroot %{_libdir}/python2.7/site-packages
%define local_etc_pmond /etc/pmon.d/
%prep
%autosetup -n %{name}-%{version} -S git
@@ -44,6 +45,9 @@ export PBR_VERSION=%{version}
--install-data=%{_datadir} \
--single-version-externally-managed
install -d -m 755 %{buildroot}%{local_etc_pmond}
install -p -D -m 644 pm-qos-mgr.conf %{buildroot}%{local_etc_pmond}/pm-qos-mgr.conf
install -p -D -m 664 pm-qos-mgr.service %{buildroot}%{_unitdir}/pm-qos-mgr.service
%post
@@ -58,4 +62,5 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/*
%{pythonroot}/%{pypi_name}/*
%{pythonroot}/%{pypi_name}-%{version}*.egg-info
%{local_etc_pmond}/pm-qos-mgr.conf
%{_unitdir}/*

View File

@@ -0,0 +1,10 @@
[process]
process = pm-qos-mgr
pidfile = /var/run/pm-qos-mgr.pid
service = pm-qos-mgr
style = lsb ; ocf or lsb
severity = major ; minor, major, critical
restarts = 3 ; restarts before error assertion
interval = 5 ; number of seconds to wait between restarts
debounce = 20 ; number of seconds to wait before degrade clear
subfunction = last-config ; run it only after last config is run

View File

@@ -6,6 +6,7 @@ Before=kubelet.service
[Service]
Type=simple
ExecStart=/usr/bin/pm-qos-mgr
ExecStartPost=/bin/bash -c 'echo $MAINPID > /var/run/pm-qos-mgr.pid'
[Install]
WantedBy=multi-user.target