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/chassis/files/obmc-phosphor-chassisd.service b/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service
index e343bdf..e981dc0 100644
--- a/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service
+++ b/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service
@@ -3,7 +3,8 @@
[Service]
Restart=always
-ExecStart={sbindir}/obmc-phosphor-chassisd
+ExecStart=/usr/bin/env obmc-phosphor-chassisd
+SyslogIdentifier=obmc-phosphor-chassisd
[Install]
WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service b/common/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service
index 2eb36d6..443ecbb 100644
--- a/common/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service
+++ b/common/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service
@@ -5,7 +5,8 @@
[Service]
Restart=always
-ExecStart={sbindir}/button_power.exe
+ExecStart=/usr/bin/env button_power.exe
+SyslogIdentifier=button_power.exe
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service b/common/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service
index 5b060e4..e535e65 100644
--- a/common/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service
+++ b/common/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service
@@ -5,7 +5,8 @@
[Service]
Restart=always
-ExecStart={sbindir}/button_reset.exe
+ExecStart=/usr/bin/env button_reset.exe
+SyslogIdentifier=button_reset.exe
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service b/common/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service
index 1620fe1..f57e9d8 100644
--- a/common/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service
+++ b/common/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service
@@ -3,7 +3,8 @@
[Service]
Restart=always
-ExecStart={sbindir}/chassis_control.py
+ExecStart=/usr/bin/env chassis_control.py
+SyslogIdentifier=chassis_control.py
Type=dbus
BusName={BUSNAME}
Environment="PYTHONUNBUFFERED=1"
diff --git a/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service b/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service
index 33b1166..ba3af05 100644
--- a/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service
+++ b/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service
@@ -7,7 +7,8 @@
Restart=no
Type=oneshot
EnvironmentFile={envfiledir}/obmc/sync_inventory_item/%I
-ExecStart={sbindir}/sync_inventory_items.py -t $FRU_TYPE -n $FRU_NAME -p ${{PROPERTY}} -s $SYNC_TYPE
+ExecStart=/usr/bin/env sync_inventory_items.py -t $FRU_TYPE -n $FRU_NAME -p ${{PROPERTY}} -s $SYNC_TYPE
+SyslogIdentifier=sync_inventory_items.py
[Install]
WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/chassis/obmc-mgr-inventory/org.openbmc.Inventory.service b/common/recipes-phosphor/chassis/obmc-mgr-inventory/org.openbmc.Inventory.service
index 0f835a6..4a9232b 100644
--- a/common/recipes-phosphor/chassis/obmc-mgr-inventory/org.openbmc.Inventory.service
+++ b/common/recipes-phosphor/chassis/obmc-mgr-inventory/org.openbmc.Inventory.service
@@ -3,7 +3,8 @@
[Service]
Restart=always
-ExecStart={sbindir}/inventory_items.py
+ExecStart=/usr/bin/env inventory_items.py
+SyslogIdentifier=inventory_items.py
Type=dbus
BusName={BUSNAME}
Environment="PYTHONUNBUFFERED=1"
diff --git a/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service b/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service
index befc892..dc3174d 100644
--- a/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service
+++ b/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service
@@ -12,7 +12,8 @@
[Service]
RemainAfterExit=yes
Type=oneshot
-ExecStart={sbindir}/mapper call /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 1
+ExecStart=/usr/bin/env mapper call /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 1
+SyslogIdentifier=mapper
[Install]
WantedBy=obmc-host-start@%i.target
diff --git a/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service b/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service
index 0833afb..1321c21 100644
--- a/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service
+++ b/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service
@@ -10,7 +10,8 @@
[Service]
RemainAfterExit=yes
-ExecStart={sbindir}/mapper call /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 0
+ExecStart=/usr/bin/env mapper call /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 0
+SyslogIdentifier=mapper
[Install]
WantedBy=obmc-host-stop@%i.target
diff --git a/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service b/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service
index 9696b1a..1137361 100644
--- a/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service
+++ b/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service
@@ -12,7 +12,8 @@
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart={sbindir}/pgood_wait /org/openbmc/control/power%i off
+ExecStart=/usr/bin/env pgood_wait /org/openbmc/control/power%i off
+SyslogIdentifier=pgood_wait
ExecStart=/bin/rm -f /run/openbmc/chassis@%i-on
ExecStart=/bin/rm -f /run/openbmc/host@%i-on
ExecStart=/bin/rm -f /run/openbmc/host@%i-request
diff --git a/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service b/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service
index cd4f513..1e65d08 100644
--- a/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service
+++ b/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service
@@ -11,7 +11,8 @@
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart={sbindir}/pgood_wait /org/openbmc/control/power%i on
+ExecStart=/usr/bin/env pgood_wait /org/openbmc/control/power%i on
+SyslogIdentifier=pgood_wait
TimeoutSec=30
[Install]
diff --git a/common/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service b/common/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service
index 4b98183..95ef0b8 100644
--- a/common/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service
+++ b/common/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service
@@ -6,7 +6,8 @@
[Service]
EnvironmentFile={envfiledir}/obmc/power_control
Restart=always
-ExecStart={sbindir}/power_control.exe $POLL_INTERVAL $PGOOD_TIMEOUT
+ExecStart=/usr/bin/env power_control.exe $POLL_INTERVAL $PGOOD_TIMEOUT
+SyslogIdentifier=power_control.exe
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service b/common/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service
index 6cc65f8..91adb76 100644
--- a/common/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service
+++ b/common/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service
@@ -7,7 +7,8 @@
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart={sbindir}/pcie_slot_present.exe
+ExecStart=/usr/bin/env pcie_slot_present.exe
+SyslogIdentifier=pcie_slot_present.exe
[Install]
WantedBy=obmc-host-start@%i.target