mtce-guest: restruct pkgs set systemd units fix paths

- Set mtce-guest rdpends to guestAgent and guestServer
- Enable guestServer service
- Disable guestAgent service
- Fix Exec[Start|Stop|Reload] paths the service files

Signed-off-by: Babak Sarashki <Babak.SarAshki@windriver.com>
This commit is contained in:
Babak Sarashki 2020-07-01 20:59:17 -07:00
parent b200b145f2
commit 19015c1b1d
3 changed files with 104 additions and 12 deletions

View File

@ -0,0 +1,34 @@
diff --git a/mtce-guest/src/scripts/guestAgent.service b/mtce-guest/src/scripts/guestAgent.service
index e88a965..5a54ba7 100644
--- a/mtce-guest/src/scripts/guestAgent.service
+++ b/mtce-guest/src/scripts/guestAgent.service
@@ -4,9 +4,9 @@ After=network.target syslog.service
[Service]
Type=forking
-ExecStart=/etc/rc.d/init.d/guestAgent start
-ExecStop=/etc/rc.d/init.d/guestAgent stop
-ExecReload=/etc/rc.d/init.d/guestAgent reload
+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
diff --git a/mtce-guest/src/scripts/guestServer.service b/mtce-guest/src/scripts/guestServer.service
index 6e2dd3a..1feb327 100644
--- a/mtce-guest/src/scripts/guestServer.service
+++ b/mtce-guest/src/scripts/guestServer.service
@@ -5,9 +5,9 @@ Before=pmon.service
[Service]
Type=forking
-ExecStart=/etc/rc.d/init.d/guestServer start
-ExecStop=/etc/rc.d/init.d/guestServer stop
-ExecReload=/etc/rc.d/init.d/guestServer reload
+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

View File

@ -0,0 +1,52 @@
diff --git a/mtce-guest/src/scripts/guestAgent b/mtce-guest/src/scripts/guestAgent
index a0a7b0e..41b5559 100644
--- a/mtce-guest/src/scripts/guestAgent
+++ b/mtce-guest/src/scripts/guestAgent
@@ -20,7 +20,7 @@
. /etc/init.d/functions
DAEMON_NAME="guestAgent"
-DAEMON="/usr/local/bin/${DAEMON_NAME}"
+DAEMON="/usr/bin/${DAEMON_NAME}"
PIDFILE="/var/run/${DAEMON_NAME}.pid"
PLATFORM_CONF="/etc/platform/platform.conf"
diff --git a/mtce-guest/src/scripts/guestAgent.service b/mtce-guest/src/scripts/guestAgent.service
index 5a54ba7..c447305 100644
--- a/mtce-guest/src/scripts/guestAgent.service
+++ b/mtce-guest/src/scripts/guestAgent.service
@@ -7,7 +7,7 @@ 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
+PIDFile=/run/guestAgent.pid
Restart=no
diff --git a/mtce-guest/src/scripts/guestServer b/mtce-guest/src/scripts/guestServer
index ace6a41..1008ad5 100644
--- a/mtce-guest/src/scripts/guestServer
+++ b/mtce-guest/src/scripts/guestServer
@@ -20,7 +20,7 @@
. /etc/init.d/functions
DAEMON_NAME="guestServer"
-DAEMON="/usr/local/bin/${DAEMON_NAME}"
+DAEMON="/usr/bin/${DAEMON_NAME}"
PIDFILE="/var/run/${DAEMON_NAME}.pid"
PLATFORM_CONF="/etc/platform/platform.conf"
diff --git a/mtce-guest/src/scripts/guestServer.service b/mtce-guest/src/scripts/guestServer.service
index 1feb327..7a63e6a 100644
--- a/mtce-guest/src/scripts/guestServer.service
+++ b/mtce-guest/src/scripts/guestServer.service
@@ -8,7 +8,7 @@ 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
+PIDFile=/run/guestServer.pid
# Failure handling
TimeoutStartSec=10s

View File

@ -1,4 +1,3 @@
PACKAGES += " mtce-guestagent"
PACKAGES += " mtce-guestserver"
@ -6,15 +5,22 @@ require nfv-common.inc
S = "${S_DIR}/mtce-guest/src"
SRC_URI += "file://0001-mtce-guest-Fix-ldflags-usage.patch"
SRC_URI += " \
file://0001-mtce-guest-Fix-ldflags-usage.patch \
file://0002-mtce-guest-agent-server-fix-script-path.patch;striplevel=3 \
file://0003-guest-agent-server-fix-daemon-paths.patch;striplevel=3 \
"
inherit systemd
SYSTEMD_PACKAGES += "mtce-guestagent"
SYSTEMD_PACKAGES += "mtce-guestserver"
SYSTEMD_SERVICE_mtce-guestagent = "guestAgent.service"
SYSTEMD_SERVICE_mtce-guestserver= "guestServer.service"
SYSTEMD_AUTO_ENABLE_mtce-geustagent = "disable"
SYSTEMD_AUTO_ENABLE_mtce-geustserver = "enable"
DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
RDEPENDS_${PN} += " mtce-guestagent mtce-guestserver"
EXTRA_OEMAKE = '-e MAJOR="1" MINONR="0" \
INCLUDES=" -I. -I${STAGING_INCDIR}/mtce-common/ -I${STAGING_INCDIR}/mtce-daemon/ " \
@ -32,24 +38,24 @@ do_install() {
}
FILES_mtce-guestserver = " \
${sysconfdir}/mtc/tmp \
${sysconfdir}/mtc/guestServer.ini \
${sysconfdir}/pmon.d/guestServer.conf \
${sysconfdir}/logrotate.d/guestServer.logrotate \
${systemd_system_unitdir}/guestServer.service \
${sysconfdir}/init.d/guestServer \
${bindir}/guestServer \
"
FILES_mtce-guestagent = " \
${sysconfdir}/mtc/tmp \
${sysconfdir}/mtc/guestAgent.ini \
${systemd_system_unitdir}/guestAgent.service \
${sysconfdir}/logrotate.d/guestAgent.logrotate \
${sysconfdir}/init.d/guestAgent \
${libdir}/ocf/resource.d/platform/guestAgent \
${bindir}/guestAgent \
"
FILE_${PN} = " "
FILE_${PN} = " \
${sysconfdir}/mtc/tmp \
${sysconfdir}/mtc/guestAgent.ini \
${sysconfdir}/mtc/guestServer.ini \
${sysconfdir}/init.d/guestServer \
${sysconfdir}/init.d/guestAgent \
${sysconfdir}/pmon.d/guestServer.conf \
${bindir}/guestServer \
${bindir}/guestAgent \
"