Enable BMC patching from the /usr/local path
This commit enables patches from the /usr/local path by replacing
absolute paths to /usr/sbin or /usr/bin in every service file with
"/usr/bin/env ". Additionally, SyslogIdentifier is added to each
file to ensure that journal entries are still distinct.
In two cases, service files also had to change due to references
to ${{PATH}}, which doesn't work with /usr/bin/env. These
references - and the corresponding definitions - were changed to
${{DEVPATH}}.
Resolves openbmc/openbmc#2149
Change-Id: I12c5c6e5101eef6820b985a563313836250ff2c7
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/common/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service b/common/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service
index 1bfda83..d9de6c0 100644
--- a/common/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service
+++ b/common/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service
@@ -6,5 +6,6 @@
[Service]
Type=oneshot
-ExecStart={bindir}/max31785-msl -p "${{PATHS}}" -b ${{BUS}} -r ${{REVISION}}
+ExecStart=/usr/bin/env max31785-msl -p "${{PATHS}}" -b ${{BUS}} -r ${{REVISION}}
EnvironmentFile={envfiledir}/obmc/hwmon-max31785/%I.conf
+SyslogIdentifier=max31785-msl
diff --git a/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service b/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service
index a091f1a..8dca3ad 100644
--- a/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service
+++ b/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service
@@ -6,5 +6,6 @@
[Service]
Restart=always
-ExecStart={sbindir}/phosphor-hwmon-readd -o %f
+ExecStart=/usr/bin/env phosphor-hwmon-readd -o %f
+SyslogIdentifier=phosphor-hwmon-readd
EnvironmentFile=/etc/default/obmc/hwmon/%I.conf