Use systemd substitutions
Make use of the new substitution feature in the Phosphor
systemd bitbake class.
Change-Id: I2db85347809ef557a53e92af3ffcf17c8003b3ce
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service b/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service
index adb47d1..aaaaa0e 100644
--- a/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service
+++ b/common/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-chassisd
+ExecStart={sbindir}/obmc-phosphor-chassisd
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service b/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service
index 74d5a7a..c3fcc03 100644
--- a/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service
+++ b/common/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service
@@ -4,8 +4,8 @@
[Service]
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
-EnvironmentFile=-/etc/default/dropbear
-ExecStart=-@SBINDIR@/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c @BINDIR@/obmc-console-client $DROPBEAR_EXTRA_ARGS
-ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+EnvironmentFile={envfiledir}/dropbear
+ExecStart=-{sbindir}/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c {bindir}/obmc-console-client $DROPBEAR_EXTRA_ARGS
+ExecReload={base_bindir}/kill -HUP $MAINPID
StandardInput=socket
KillMode=process
diff --git a/common/recipes-phosphor/console/obmc-console/obmc-console.service b/common/recipes-phosphor/console/obmc-console/obmc-console.service
index 2f540ea..032dc2e 100644
--- a/common/recipes-phosphor/console/obmc-console/obmc-console.service
+++ b/common/recipes-phosphor/console/obmc-console/obmc-console.service
@@ -2,8 +2,8 @@
Description=OpenBMC console daemon
[Service]
-ExecStart=/usr/sbin/obmc-console-server ttyS0
+ExecStart={sbindir}/obmc-console-server ttyS0
Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/dbus/obmc-mapper/org.openbmc.ObjectMapper.service b/common/recipes-phosphor/dbus/obmc-mapper/org.openbmc.ObjectMapper.service
index b397e2f..1f1e832 100644
--- a/common/recipes-phosphor/dbus/obmc-mapper/org.openbmc.ObjectMapper.service
+++ b/common/recipes-phosphor/dbus/obmc-mapper/org.openbmc.ObjectMapper.service
@@ -5,10 +5,10 @@
[Service]
Restart=always
Type=dbus
-ExecStart=/usr/sbin/phosphor-mapper
-BusName=org.openbmc.ObjectMapper
+ExecStart={sbindir}/phosphor-mapper
+BusName={BUSNAME}
TimeoutStartSec=300
Environment="PYTHONUNBUFFERED=1"
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/events/files/obmc-phosphor-event.service b/common/recipes-phosphor/events/files/obmc-phosphor-event.service
index a93fce0..5aadcc0 100644
--- a/common/recipes-phosphor/events/files/obmc-phosphor-event.service
+++ b/common/recipes-phosphor/events/files/obmc-phosphor-event.service
@@ -4,7 +4,7 @@
[Service]
EnvironmentFile=-/etc/default/eventd/eventd.conf
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-eventd $OPTIONS
+ExecStart={sbindir}/obmc-phosphor-eventd $OPTIONS
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/examples/files/org.openbmc.examples.PythonService.service b/common/recipes-phosphor/examples/files/org.openbmc.examples.PythonService.service
index 27d9bfe..531c49d 100644
--- a/common/recipes-phosphor/examples/files/org.openbmc.examples.PythonService.service
+++ b/common/recipes-phosphor/examples/files/org.openbmc.examples.PythonService.service
@@ -3,8 +3,8 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-example-pydbus
+ExecStart={sbindir}/obmc-phosphor-example-pydbus
Environment="PYTHONUNBUFFERED=1"
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/examples/obmc-phosphor-example-sdbus/org.openbmc.examples.SDBusService.service b/common/recipes-phosphor/examples/obmc-phosphor-example-sdbus/org.openbmc.examples.SDBusService.service
index 442e910..7bdfc56 100644
--- a/common/recipes-phosphor/examples/obmc-phosphor-example-sdbus/org.openbmc.examples.SDBusService.service
+++ b/common/recipes-phosphor/examples/obmc-phosphor-example-sdbus/org.openbmc.examples.SDBusService.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-example-sdbus
+ExecStart={sbindir}/obmc-phosphor-example-sdbus
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/fans/files/obmc-phosphor-fand.service b/common/recipes-phosphor/fans/files/obmc-phosphor-fand.service
index 6698e12..9008954 100644
--- a/common/recipes-phosphor/fans/files/obmc-phosphor-fand.service
+++ b/common/recipes-phosphor/fans/files/obmc-phosphor-fand.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-fand
+ExecStart={sbindir}/obmc-phosphor-fand
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/flash/files/obmc-phosphor-flashd.service b/common/recipes-phosphor/flash/files/obmc-phosphor-flashd.service
index 1b1b892..ee1640a 100644
--- a/common/recipes-phosphor/flash/files/obmc-phosphor-flashd.service
+++ b/common/recipes-phosphor/flash/files/obmc-phosphor-flashd.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-flashd
+ExecStart={sbindir}/obmc-phosphor-flashd
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/host-ipmid/btbridged/btbridged.service b/common/recipes-phosphor/host-ipmid/btbridged/btbridged.service
index ffc3110..e032e8f 100644
--- a/common/recipes-phosphor/host-ipmid/btbridged/btbridged.service
+++ b/common/recipes-phosphor/host-ipmid/btbridged/btbridged.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/btbridged
+ExecStart={sbindir}/btbridged
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/host-ipmid/host-ipmid/host-ipmid.service b/common/recipes-phosphor/host-ipmid/host-ipmid/host-ipmid.service
index f882880..dc3adae 100644
--- a/common/recipes-phosphor/host-ipmid/host-ipmid/host-ipmid.service
+++ b/common/recipes-phosphor/host-ipmid/host-ipmid/host-ipmid.service
@@ -5,7 +5,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/ipmid
+ExecStart={sbindir}/ipmid
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/inarp/inarp/inarp.service b/common/recipes-phosphor/inarp/inarp/inarp.service
index 4aba68f..4ed7ee4 100644
--- a/common/recipes-phosphor/inarp/inarp/inarp.service
+++ b/common/recipes-phosphor/inarp/inarp/inarp.service
@@ -2,8 +2,8 @@
Description=Phosphor Inverse ARP daemon
[Service]
-ExecStart=/usr/sbin/inarp
+ExecStart={sbindir}/inarp
Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/network/network/network-update-dns.service b/common/recipes-phosphor/network/network/network-update-dns.service
index 490b9ce..43e0131 100644
--- a/common/recipes-phosphor/network/network/network-update-dns.service
+++ b/common/recipes-phosphor/network/network/network-update-dns.service
@@ -4,8 +4,8 @@
After=network.service
[Service]
-ExecStart=/usr/sbin/netman_watch_dns /run/systemd/netif/state
+ExecStart={sbindir}/netman_watch_dns /run/systemd/netif/state
Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/network/network/network.service b/common/recipes-phosphor/network/network/network.service
index cb4fc3f..905020e 100644
--- a/common/recipes-phosphor/network/network/network.service
+++ b/common/recipes-phosphor/network/network/network.service
@@ -2,9 +2,9 @@
Description=Network DBUS object
[Service]
-ExecStart=/usr/sbin/netman.py
+ExecStart={sbindir}/netman.py
Environment="PYTHONUNBUFFERED=1"
Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/rest-dbus/files/rest-dbus.service b/common/recipes-phosphor/rest-dbus/files/rest-dbus.service
index d3bddab..d22d2a2 100644
--- a/common/recipes-phosphor/rest-dbus/files/rest-dbus.service
+++ b/common/recipes-phosphor/rest-dbus/files/rest-dbus.service
@@ -3,5 +3,5 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/rest-dbus
+ExecStart={sbindir}/rest-dbus
Environment="PYTHONUNBUFFERED=1"
diff --git a/common/recipes-phosphor/sensors/files/obmc-phosphor-sensord.service b/common/recipes-phosphor/sensors/files/obmc-phosphor-sensord.service
index 247164f..bf203f8 100644
--- a/common/recipes-phosphor/sensors/files/obmc-phosphor-sensord.service
+++ b/common/recipes-phosphor/sensors/files/obmc-phosphor-sensord.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-sensord
+ExecStart={sbindir}/obmc-phosphor-sensord
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/settings/settings/settings.service b/common/recipes-phosphor/settings/settings/settings.service
index e53005e..0fd0a24 100755
--- a/common/recipes-phosphor/settings/settings/settings.service
+++ b/common/recipes-phosphor/settings/settings/settings.service
@@ -2,9 +2,9 @@
Description=Settings DBUS Object
[Service]
-ExecStart=/usr/sbin/settings_manager.py
+ExecStart={sbindir}/settings_manager.py
Environment="PYTHONUNBUFFERED=1"
Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/system/files/obmc-phosphor-sysd.service b/common/recipes-phosphor/system/files/obmc-phosphor-sysd.service
index 3a68b68..71e0b0c 100644
--- a/common/recipes-phosphor/system/files/obmc-phosphor-sysd.service
+++ b/common/recipes-phosphor/system/files/obmc-phosphor-sysd.service
@@ -3,7 +3,7 @@
[Service]
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-sysd
+ExecStart={sbindir}/obmc-phosphor-sysd
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/users/files/obmc-phosphor-user.service b/common/recipes-phosphor/users/files/obmc-phosphor-user.service
index 7c1ffce..e11a0a9 100644
--- a/common/recipes-phosphor/users/files/obmc-phosphor-user.service
+++ b/common/recipes-phosphor/users/files/obmc-phosphor-user.service
@@ -2,9 +2,9 @@
Description=Phosphor OpenBMC user management daemon
[Service]
-ExecStart=/usr/sbin/obmc-phosphor-userd
+ExecStart={sbindir}/obmc-phosphor-userd
Environment="PYTHONUNBUFFERED=1"
Restart=always
[Install]
-WantedBy=multi-user.target
+WantedBy={SYSTEMD_DEFAULT_TARGET}