diff mbox series

[v2,6/9] package/connman: adapt to preset-all

Message ID 20191111172443.6874-7-jeremy.rosen@smile.fr
State Changes Requested
Headers show
Series use host-systemd to enable units | expand

Commit Message

Jérémy ROSEN Nov. 11, 2019, 5:24 p.m. UTC
connman has two services
* connman.service which is the real daemon
* connman-wait-online.service which is a sync point for network-online.target

Only the first one was enabled. This adaptation enables both.

Not enabling connman-wait-online.service is probably a bug
---
 package/connman/connman.mk | 6 ------
 1 file changed, 6 deletions(-)

Comments

Yann E. MORIN Dec. 5, 2019, 12:57 p.m. UTC | #1
Jérémy, All,

On 2019-11-11 18:24 +0100, Jérémy Rosen spake thusly:
> connman has two services
> * connman.service which is the real daemon
> * connman-wait-online.service which is a sync point for network-online.target
> 
> Only the first one was enabled. This adaptation enables both.
> 
> Not enabling connman-wait-online.service is probably a bug

If that was not installed so far, what would provide for the
network-online.target instead? Or was that target always satisfied?

BTW, you forgot your SoB line too.

Reviewed-by: Yann E. MORIN <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/connman/connman.mk | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/package/connman/connman.mk b/package/connman/connman.mk
> index 839bc7a0e2..d70eb1ac82 100644
> --- a/package/connman/connman.mk
> +++ b/package/connman/connman.mk
> @@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
>  	$(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman
>  endef
>  
> -define CONNMAN_INSTALL_INIT_SYSTEMD
> -	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> -	ln -fs ../../../../usr/lib/systemd/system/connman.service \
> -		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
> -endef
> -
>  ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
>  CONNMAN_CONF_OPTS += --enable-client
>  CONNMAN_DEPENDENCIES += readline
> -- 
> 2.24.0.rc1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Jérémy ROSEN Dec. 7, 2019, 12:19 p.m. UTC | #2
The network-online is a bit complicated...

* network-managers provide XXX-wait-online.service
   * block until "the network is up" (whatever that means for that
particular NM)
   * WantedBy= and Before= network-online.target
* systemd provides network-online.target, which is thus always available,
but not started as part of the boot process
* any daemon that wants to be started after the network is up has Wants=
and After= network-online.target

So, technically, with systemd the network is not configured at boot time.
It is configured before we start a
daemon that needs the network.

Now, if no NM provide any XXX-wait-online.service, network-online.target
will be started right away, it will not
wait for the network to be up and the dependant services too early.

This is consistent with the network-online.target semantic which is "the
point during the boot where either the
network is up or the network has failed"
If there is no NM at all, there is no network, so network-online triggers
immediately.

Le jeu. 5 déc. 2019 à 13:57, Yann E. MORIN <yann.morin.1998@free.fr> a
écrit :

> Jérémy, All,
>
> On 2019-11-11 18:24 +0100, Jérémy Rosen spake thusly:
> > connman has two services
> > * connman.service which is the real daemon
> > * connman-wait-online.service which is a sync point for
> network-online.target
> >
> > Only the first one was enabled. This adaptation enables both.
> >
> > Not enabling connman-wait-online.service is probably a bug
>
> If that was not installed so far, what would provide for the
> network-online.target instead? Or was that target always satisfied?
>
> BTW, you forgot your SoB line too.
>
> Reviewed-by: Yann E. MORIN <yann.morin.1998@free.fr>
>
> Regards,
> Yann E. MORIN.
>
> > ---
> >  package/connman/connman.mk | 6 ------
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/package/connman/connman.mk b/package/connman/connman.mk
> > index 839bc7a0e2..d70eb1ac82 100644
> > --- a/package/connman/connman.mk
> > +++ b/package/connman/connman.mk
> > @@ -32,12 +32,6 @@ define CONNMAN_INSTALL_INIT_SYSV
> >       $(INSTALL) -m 0755 -D package/connman/S45connman
> $(TARGET_DIR)/etc/init.d/S45connman
> >  endef
> >
> > -define CONNMAN_INSTALL_INIT_SYSTEMD
> > -     mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> > -     ln -fs ../../../../usr/lib/systemd/system/connman.service \
> > -
>  $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
> > -endef
> > -
> >  ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
> >  CONNMAN_CONF_OPTS += --enable-client
> >  CONNMAN_DEPENDENCIES += readline
> > --
> > 2.24.0.rc1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>
diff mbox series

Patch

diff --git a/package/connman/connman.mk b/package/connman/connman.mk
index 839bc7a0e2..d70eb1ac82 100644
--- a/package/connman/connman.mk
+++ b/package/connman/connman.mk
@@ -32,12 +32,6 @@  define CONNMAN_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/connman/S45connman $(TARGET_DIR)/etc/init.d/S45connman
 endef
 
-define CONNMAN_INSTALL_INIT_SYSTEMD
-	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../../../../usr/lib/systemd/system/connman.service \
-		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/connman.service
-endef
-
 ifeq ($(BR2_PACKAGE_CONNMAN_CLIENT),y)
 CONNMAN_CONF_OPTS += --enable-client
 CONNMAN_DEPENDENCIES += readline