From 8df3b253502f5bec986e1e5c66705288f64e2d8f Mon Sep 17 00:00:00 2001 From: Babak Sarashki Date: Wed, 1 Jul 2020 21:05:08 -0700 Subject: [PATCH] sysinv-agent: rm legacy PIDFOLE and enable unit file - Enables sysinv-agent.service by default - Set PIDFILE to /run/sysinv-agent.pid Signed-off-by: Babak Sarashki --- ...nv-agent-remove-legacy-pid-directory.patch | 25 +++++++++++++++++++ meta-stx-flock/stx-config/sysinv-agent.bb | 4 ++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 meta-stx-flock/stx-config/files/0003-sysinv-agent-remove-legacy-pid-directory.patch diff --git a/meta-stx-flock/stx-config/files/0003-sysinv-agent-remove-legacy-pid-directory.patch b/meta-stx-flock/stx-config/files/0003-sysinv-agent-remove-legacy-pid-directory.patch new file mode 100644 index 0000000..b0802d4 --- /dev/null +++ b/meta-stx-flock/stx-config/files/0003-sysinv-agent-remove-legacy-pid-directory.patch @@ -0,0 +1,25 @@ +diff --git a/sysinv/sysinv-agent/sysinv-agent.conf b/sysinv/sysinv-agent/sysinv-agent.conf +index 46afac67b..aad37576c 100644 +--- a/sysinv/sysinv-agent/sysinv-agent.conf ++++ b/sysinv/sysinv-agent/sysinv-agent.conf +@@ -1,6 +1,6 @@ + [process] + process = sysinv-agent +-pidfile = /var/run/sysinv-agent.pid ++pidfile = /run/sysinv-agent.pid + script = /etc/init.d/sysinv-agent + style = lsb ; ocf or lsb + severity = major ; minor, major, critical +diff --git a/sysinv/sysinv-agent/sysinv-agent.service b/sysinv/sysinv-agent/sysinv-agent.service +index cb8663f68..37c2c221e 100644 +--- a/sysinv/sysinv-agent/sysinv-agent.service ++++ b/sysinv/sysinv-agent/sysinv-agent.service +@@ -9,7 +9,7 @@ Type=forking + RemainAfterExit=yes + ExecStart=/etc/init.d/sysinv-agent start + ExecStop=/etc/init.d/sysinv-agent stop +-PIDFile=/var/run/sysinv-agent.pid ++PIDFile=/run/sysinv-agent.pid + + [Install] + WantedBy=multi-user.target diff --git a/meta-stx-flock/stx-config/sysinv-agent.bb b/meta-stx-flock/stx-config/sysinv-agent.bb index 0ec46e4..1e9cef8 100644 --- a/meta-stx-flock/stx-config/sysinv-agent.bb +++ b/meta-stx-flock/stx-config/sysinv-agent.bb @@ -6,12 +6,14 @@ S = "${S_DIR}/sysinv/sysinv-agent" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" +SRC_URI += "file://0003-sysinv-agent-remove-legacy-pid-directory.patch;striplevel=3" + RDEPENDS_sysinv-agent += " python" inherit systemd SYSTEMD_PACKAGES += "sysinv-agent" SYSTEMD_SERVICE_sysinv-agent = "sysinv-agent.service" -SYSTEMD_AUTO_ENABLE_sysinv-agent = "disable" +SYSTEMD_AUTO_ENABLE_${PN} = "enable" do_configure[noexec] = "1" do_compile[noexec] = "1"