All of lore.kernel.org
 help / color / mirror / Atom feed
* build: hook up traditional dbus activation
@ 2020-07-31 18:24 Andreas Henriksson
  2020-07-31 18:39 ` Marcel Holtmann
  2020-07-31 18:52 ` Denis Kenzior
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Henriksson @ 2020-07-31 18:24 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 3858 bytes --]

On systems using systemd dbus will use the SystemdServices= directive,
but on non-systemd systems the so called "traditional dbus activation"
method involves reading the Exec= directive. Setting that to /bin/false
means this service is not relevant on non-systemd systems, but
apparently there's an interest from users of such systems to use
iwd (and possibly ead). Thus hook up the expansion of the paths in the
Exec= directive of the dbus service files to allow the traditional dbus
activation to start respective daemon.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 Makefile.am                      | 11 ++++++-----
 src/net.connman.iwd.service      |  5 -----
 src/net.connman.iwd.service.in   |  5 +++++
 wired/net.connman.ead.service    |  5 -----
 wired/net.connman.ead.service.in |  5 +++++
 5 files changed, 16 insertions(+), 15 deletions(-)
 delete mode 100644 src/net.connman.iwd.service
 create mode 100644 src/net.connman.iwd.service.in
 delete mode 100644 wired/net.connman.ead.service
 create mode 100644 wired/net.connman.ead.service.in

diff --git a/Makefile.am b/Makefile.am
index 57c694d..006d1d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -250,7 +250,7 @@ dist_dbus_data_DATA += src/iwd-dbus.conf
 endif
 
 if SYSTEMD_SERVICE
-src_iwd_DEPENDENCIES += src/iwd.service
+src_iwd_DEPENDENCIES += src/iwd.service src/net.connman.iwd.service
 
 systemd_unit_DATA += src/iwd.service
 dbus_bus_DATA += src/net.connman.iwd.service
@@ -328,7 +328,7 @@ dist_dbus_data_DATA += wired/ead-dbus.conf
 endif
 
 if SYSTEMD_SERVICE
-wired_ead_DEPENDENCIES += wired/ead.service
+wired_ead_DEPENDENCIES += wired/ead.service wired/net.connman.ead.service
 
 systemd_unit_DATA += wired/ead.service
 dbus_bus_DATA += wired/net.connman.ead.service
@@ -524,8 +524,8 @@ unit_test_p2p_LDADD = $(ell_ldadd)
 
 TESTS = $(unit_tests)
 
-EXTRA_DIST = src/genbuiltin src/iwd.service.in src/net.connman.iwd.service \
-			wired/ead.service.in wired/net.connman.ead.service \
+EXTRA_DIST = src/genbuiltin src/iwd.service.in src/net.connman.iwd.service.in \
+			wired/ead.service.in wired/net.connman.ead.service.in \
 			src/80-iwd.link src/pkcs8.conf unit/gencerts.cnf \
 			$(manual_pages) $(patsubst %.1,%.rst, \
 					$(patsubst %.5,%.rst, \
@@ -539,7 +539,8 @@ if MAINTAINER_MODE
 AM_CFLAGS += -DHAVE_PKCS8_SUPPORT
 endif
 
-CLEANFILES = src/iwd.service wired/ead.service
+CLEANFILES = src/iwd.service wired/ead.service \
+	     src/net.connman.iwd.service wired/net.connman.ead.service
 
 DISTCHECK_CONFIGURE_FLAGS = --disable-dbus-policy --disable-systemd-service \
 				--enable-sim-hardcoded \
diff --git a/src/net.connman.iwd.service b/src/net.connman.iwd.service
deleted file mode 100644
index d8ece4c..0000000
--- a/src/net.connman.iwd.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=net.connman.iwd
-Exec=/bin/false
-User=root
-SystemdService=iwd.service
diff --git a/src/net.connman.iwd.service.in b/src/net.connman.iwd.service.in
new file mode 100644
index 0000000..a7cb7ed
--- /dev/null
+++ b/src/net.connman.iwd.service.in
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=net.connman.iwd
+Exec=@libexecdir@/iwd
+User=root
+SystemdService=iwd.service
diff --git a/wired/net.connman.ead.service b/wired/net.connman.ead.service
deleted file mode 100644
index 24af96b..0000000
--- a/wired/net.connman.ead.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=net.connman.ead
-Exec=/bin/false
-User=root
-SystemdService=ead.service
diff --git a/wired/net.connman.ead.service.in b/wired/net.connman.ead.service.in
new file mode 100644
index 0000000..63e5011
--- /dev/null
+++ b/wired/net.connman.ead.service.in
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=net.connman.ead
+Exec=@libexecdir@/ead
+User=root
+SystemdService=ead.service

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: build: hook up traditional dbus activation
  2020-07-31 18:24 build: hook up traditional dbus activation Andreas Henriksson
@ 2020-07-31 18:39 ` Marcel Holtmann
  2020-07-31 19:28   ` Andreas Henriksson
  2020-07-31 18:52 ` Denis Kenzior
  1 sibling, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2020-07-31 18:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 4351 bytes --]

Hi Andreas,

> On systems using systemd dbus will use the SystemdServices= directive,
> but on non-systemd systems the so called "traditional dbus activation"
> method involves reading the Exec= directive. Setting that to /bin/false
> means this service is not relevant on non-systemd systems, but
> apparently there's an interest from users of such systems to use
> iwd (and possibly ead). Thus hook up the expansion of the paths in the
> Exec= directive of the dbus service files to allow the traditional dbus
> activation to start respective daemon.
> 
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>
> ---
> Makefile.am                      | 11 ++++++-----
> src/net.connman.iwd.service      |  5 -----
> src/net.connman.iwd.service.in   |  5 +++++
> wired/net.connman.ead.service    |  5 -----
> wired/net.connman.ead.service.in |  5 +++++
> 5 files changed, 16 insertions(+), 15 deletions(-)
> delete mode 100644 src/net.connman.iwd.service
> create mode 100644 src/net.connman.iwd.service.in
> delete mode 100644 wired/net.connman.ead.service
> create mode 100644 wired/net.connman.ead.service.in
> 
> diff --git a/Makefile.am b/Makefile.am
> index 57c694d..006d1d1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -250,7 +250,7 @@ dist_dbus_data_DATA += src/iwd-dbus.conf
> endif
> 
> if SYSTEMD_SERVICE
> -src_iwd_DEPENDENCIES += src/iwd.service
> +src_iwd_DEPENDENCIES += src/iwd.service src/net.connman.iwd.service
> 
> systemd_unit_DATA += src/iwd.service
> dbus_bus_DATA += src/net.connman.iwd.service
> @@ -328,7 +328,7 @@ dist_dbus_data_DATA += wired/ead-dbus.conf
> endif
> 
> if SYSTEMD_SERVICE
> -wired_ead_DEPENDENCIES += wired/ead.service
> +wired_ead_DEPENDENCIES += wired/ead.service wired/net.connman.ead.service
> 
> systemd_unit_DATA += wired/ead.service
> dbus_bus_DATA += wired/net.connman.ead.service
> @@ -524,8 +524,8 @@ unit_test_p2p_LDADD = $(ell_ldadd)
> 
> TESTS = $(unit_tests)
> 
> -EXTRA_DIST = src/genbuiltin src/iwd.service.in src/net.connman.iwd.service \
> -			wired/ead.service.in wired/net.connman.ead.service \
> +EXTRA_DIST = src/genbuiltin src/iwd.service.in src/net.connman.iwd.service.in \
> +			wired/ead.service.in wired/net.connman.ead.service.in \
> 			src/80-iwd.link src/pkcs8.conf unit/gencerts.cnf \
> 			$(manual_pages) $(patsubst %.1,%.rst, \
> 					$(patsubst %.5,%.rst, \
> @@ -539,7 +539,8 @@ if MAINTAINER_MODE
> AM_CFLAGS += -DHAVE_PKCS8_SUPPORT
> endif
> 
> -CLEANFILES = src/iwd.service wired/ead.service
> +CLEANFILES = src/iwd.service wired/ead.service \
> +	     src/net.connman.iwd.service wired/net.connman.ead.service
> 
> DISTCHECK_CONFIGURE_FLAGS = --disable-dbus-policy --disable-systemd-service \
> 				--enable-sim-hardcoded \
> diff --git a/src/net.connman.iwd.service b/src/net.connman.iwd.service
> deleted file mode 100644
> index d8ece4c..0000000
> --- a/src/net.connman.iwd.service
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -[D-BUS Service]
> -Name=net.connman.iwd
> -Exec=/bin/false
> -User=root
> -SystemdService=iwd.service
> diff --git a/src/net.connman.iwd.service.in b/src/net.connman.iwd.service.in
> new file mode 100644
> index 0000000..a7cb7ed
> --- /dev/null
> +++ b/src/net.connman.iwd.service.in
> @@ -0,0 +1,5 @@
> +[D-BUS Service]
> +Name=net.connman.iwd
> +Exec=@libexecdir@/iwd
> +User=root
> +SystemdService=iwd.service
> diff --git a/wired/net.connman.ead.service b/wired/net.connman.ead.service
> deleted file mode 100644
> index 24af96b..0000000
> --- a/wired/net.connman.ead.service
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -[D-BUS Service]
> -Name=net.connman.ead
> -Exec=/bin/false
> -User=root
> -SystemdService=ead.service
> diff --git a/wired/net.connman.ead.service.in b/wired/net.connman.ead.service.in
> new file mode 100644
> index 0000000..63e5011
> --- /dev/null
> +++ b/wired/net.connman.ead.service.in
> @@ -0,0 +1,5 @@
> +[D-BUS Service]
> +Name=net.connman.ead
> +Exec=@libexecdir@/ead
> +User=root
> +SystemdService=ead.service

I am reluctant to go back to this since it is also not really working like this. This most likely needs a two-stage setup with an Alias (which we had at one point). And frankly the non-systemd distros can ship a modified file. We don’t have to make everybody happy.

Regards

Marcel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build: hook up traditional dbus activation
  2020-07-31 18:24 build: hook up traditional dbus activation Andreas Henriksson
  2020-07-31 18:39 ` Marcel Holtmann
@ 2020-07-31 18:52 ` Denis Kenzior
  2020-07-31 19:37   ` Andreas Henriksson
  1 sibling, 1 reply; 7+ messages in thread
From: Denis Kenzior @ 2020-07-31 18:52 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

Hi Andreas,

On 7/31/20 1:24 PM, Andreas Henriksson wrote:
> On systems using systemd dbus will use the SystemdServices= directive,
> but on non-systemd systems the so called "traditional dbus activation"
> method involves reading the Exec= directive. Setting that to /bin/false
> means this service is not relevant on non-systemd systems, but
> apparently there's an interest from users of such systems to use
> iwd (and possibly ead). Thus hook up the expansion of the paths in the
> Exec= directive of the dbus service files to allow the traditional dbus
> activation to start respective daemon.

Just curious.  Can you elaborate a bit on the reasons behind the request?

> 
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>

We do not use SoB btw.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build: hook up traditional dbus activation
  2020-07-31 18:39 ` Marcel Holtmann
@ 2020-07-31 19:28   ` Andreas Henriksson
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2020-07-31 19:28 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

Hello Marcel,

On Fri, Jul 31, 2020 at 08:39:25PM +0200, Marcel Holtmann wrote:
[...]
> I am reluctant to go back to this since it is also not really working
> like this. This most likely needs a two-stage setup with an Alias
> (which we had at one point).

Thanks for your quick reply. (And no I didn't actually test if this
worked, just that the build generated the result I expected.)

With your hints about alias I looked at git history but only found
the systemd service using an alias in the past, never the Exec=
in the dbus configuration being anything else than /bin/false...
sure you're not mixing up past memories?

FWIW I was about to add that shipping the dbus configuration (and
mangling it to remove SystemdService=....) even when building with
--disable-systemd-service is also left as an excercise for those with
haptephobia.

(I have no personal interest in any of this.)

> And frankly the non-systemd distros can ship a modified file. We don’t
> have to make everybody happy.

Hopefully this discussion gives enough hints for them to figure out how
to get the dbus activation going for themselves...

Regards,
Andreas Henriksson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build: hook up traditional dbus activation
  2020-07-31 18:52 ` Denis Kenzior
@ 2020-07-31 19:37   ` Andreas Henriksson
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2020-07-31 19:37 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 583 bytes --]

Hello Denis Kenzior,

On Fri, Jul 31, 2020 at 01:52:35PM -0500, Denis Kenzior wrote:
[...]
> Just curious.  Can you elaborate a bit on the reasons behind the request?
[...]

I (as Debian package maintainer) got a bug report with over-inflated
severity from the Devuan people about sysvinit. Figured they probably
need help to understand dbus activation so decided to send a patch on
for their benefit and see what gives. The original reporter is CCed and
can likely expand on their reasoning.

(I have no personal interest in this topic.)

Regards,
Andreas Henriksson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build: hook up traditional dbus activation
       [not found] <uruANJg_J76J43r_UsAABIzdnz2yDgDWjMCYMHBxe7yAx-xb1uhPW744L4BxF6bYTiDmC0A8LMEFLzwvXcAd6cEi5a4NT8sgP9uhLjVgEEM=@protonmail.com>
  2020-08-03 21:43 ` Denis Kenzior
@ 2020-08-04  5:57 ` Marcel Holtmann
  1 sibling, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2020-08-04  5:57 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 2545 bytes --]

Hi Job,

> Hi, I am the original reporter Andreas is talking about. I'm going to admit that I have no idea on how to use dbus activation. I only know how to start a service at boot via shell scripts.
> 
> I understand if you won't support non-systemd init systems like sysvinit. I haven't maintained daemons, but from the looks of it, maintaining support for multiple inits is surely hard. However users who don't use systemd as their init, like Devuan users, Gentoo users, and Debian users who replaced systemd with sysvinit/openrc would appreciate it if upstream decided to support multiple inits. Gentoo users have a community which maintains their own iwd init script for openrc. Devuan users however, have to workaround this problem by converting the iwd systemd service file to a sysvinit script, and update-rc.d as root. If I haven't known about this, I would still be using wpa_supplicant by now. iwd actually made my wifi connection more reliable. When I was using wpa_supplicant, I had to reboot my system everytime the connection drops. With iwd, I only have to restart iwd and my connection is back. I figured that I should contribute back to the community by adding sysvinit support.
> 
> So whatever decision you guys make, I will respect it. As you said, we can ship a modified version instead for non-systemd users. I am already preparing a fork of the iwd package for Devuan users[1]. The patch is ugly, but it works.

so about 16 something years ago (long before systemd), I tried to provide init scripts for all the distributions. It was a disaster since all of them are a bit different. So I decided to not do that anymore and the distro package maintainers have to do that job as downstream. It makes no sense that upstream carries the work of downstream anyway. It is just the wrong direction.

With systemd unit files there was a unified way across distribution to describe the daemon/service and so I started to include these. So unit files etc. can stay upstream because they are common across all distribution. Any init scripts can’t be accepted.

D-Bus activation for system level daemons outside of systemd is something I found always a bit hackish to begin with and thus it is not something that is worth while supporting. iwd is designed to be start and it can linger around until WiFi hardware is found since it is truly hotplug capable.

In summary, if distributions need a sysvinit or openrc integration, then it is the job of the distro package maintainer to provide that.

Regards

Marcel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build: hook up traditional dbus activation
       [not found] <uruANJg_J76J43r_UsAABIzdnz2yDgDWjMCYMHBxe7yAx-xb1uhPW744L4BxF6bYTiDmC0A8LMEFLzwvXcAd6cEi5a4NT8sgP9uhLjVgEEM=@protonmail.com>
@ 2020-08-03 21:43 ` Denis Kenzior
  2020-08-04  5:57 ` Marcel Holtmann
  1 sibling, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2020-08-03 21:43 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Hi Job,

> I understand if you won't support non-systemd init systems like sysvinit. I haven't maintained daemons, but from the looks of it, maintaining support for multiple inits is surely hard. However users who don't use systemd as their init, like Devuan users, Gentoo users, and Debian users who replaced systemd with sysvinit/openrc would appreciate it if upstream decided to support multiple inits. Gentoo users have a community which maintains their own iwd init script for openrc. Devuan users however, have to workaround this problem by converting the iwd systemd service file to a sysvinit script, and update-rc.d as root. If I haven't known about this, I would still be using wpa_supplicant by now. iwd actually made my wifi connection more reliable. When I was using wpa_supplicant, I had to reboot my system everytime the connection drops. With iwd, I only have to restart iwd and my connection is back. I figured that I should contribute back to the community by adding sysvinit support.

I'm still a bit lost why D-Bus activation is needed?  Is sysvinit/openrc somehow 
using it to start daemons?

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-04  5:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31 18:24 build: hook up traditional dbus activation Andreas Henriksson
2020-07-31 18:39 ` Marcel Holtmann
2020-07-31 19:28   ` Andreas Henriksson
2020-07-31 18:52 ` Denis Kenzior
2020-07-31 19:37   ` Andreas Henriksson
     [not found] <uruANJg_J76J43r_UsAABIzdnz2yDgDWjMCYMHBxe7yAx-xb1uhPW744L4BxF6bYTiDmC0A8LMEFLzwvXcAd6cEi5a4NT8sgP9uhLjVgEEM=@protonmail.com>
2020-08-03 21:43 ` Denis Kenzior
2020-08-04  5:57 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.