diff mbox

systemd: Update service files according to dbus interface version used

Message ID 1460379335-10128-1-git-send-email-m.niestroj@grinn-global.com
State Accepted
Headers show

Commit Message

Marcin Niestroj April 11, 2016, 12:55 p.m. UTC
systemd service files were supplied with old DBus bus name. After
service activation systemd was waiting for appearance of specified bus
name to consider it started successfully. However, if wpa_supplicant was
compiled only with new dbus interface name, then systemd didn't notice
configured (old) DBus bus name appearance. In the end service was
considered malfunctioning and it was deactivated.

Update systemd service BusName property according to supported DBus
interface version.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
---
 wpa_supplicant/Makefile                          | 8 ++++++--
 wpa_supplicant/systemd/wpa_supplicant.service.in | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

Comments

Jouni Malinen April 18, 2016, 10:15 p.m. UTC | #1
On Mon, Apr 11, 2016 at 02:55:35PM +0200, Marcin Niestroj wrote:
> systemd service files were supplied with old DBus bus name. After
> service activation systemd was waiting for appearance of specified bus
> name to consider it started successfully. However, if wpa_supplicant was
> compiled only with new dbus interface name, then systemd didn't notice
> configured (old) DBus bus name appearance. In the end service was
> considered malfunctioning and it was deactivated.
> 
> Update systemd service BusName property according to supported DBus
> interface version.

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 550d44b..3a83363 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1382,6 +1382,7 @@  ifndef DBUS_INCLUDE
 DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
 endif
 DBUS_CFLAGS += $(DBUS_INCLUDE)
+DBUS_INTERFACE=fi.epitest.hostap.WPASupplicant
 endif
 
 ifdef CONFIG_CTRL_IFACE_DBUS_NEW
@@ -1407,6 +1408,7 @@  DBUS_OBJS += dbus/dbus_new_introspect.o
 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
 endif
 DBUS_CFLAGS += $(DBUS_INCLUDE)
+DBUS_INTERFACE=fi.w1.wpa_supplicant1
 endif
 
 ifdef DBUS
@@ -1769,11 +1771,13 @@  else
 endif
 
 %.service: %.service.in
-	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
+	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
+		-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
 	@$(E) "  sed" $<
 
 %@.service: %.service.arg.in
-	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
+	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
+		-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
 	@$(E) "  sed" $<
 
 wpa_supplicant.exe: wpa_supplicant
diff --git a/wpa_supplicant/systemd/wpa_supplicant.service.in b/wpa_supplicant/systemd/wpa_supplicant.service.in
index ea964ce..bc5d49a 100644
--- a/wpa_supplicant/systemd/wpa_supplicant.service.in
+++ b/wpa_supplicant/systemd/wpa_supplicant.service.in
@@ -5,9 +5,9 @@  Wants=network.target
 
 [Service]
 Type=dbus
-BusName=fi.epitest.hostap.WPASupplicant
+BusName=@DBUS_INTERFACE@
 ExecStart=@BINDIR@/wpa_supplicant -u
 
 [Install]
 WantedBy=multi-user.target
-Alias=dbus-fi.epitest.hostap.WPASupplicant.service
+Alias=dbus-@DBUS_INTERFACE@.service