[PATCH 2/2] connman-wait-online.service.in: systemd service that waits for network

2014-10-22 Thread Noé Rubinstein
Create a systemd service that uses test/wait-for-ready to wait for any
interface to be in the 'ready' or 'online' state. This service will be
pulled by network-online.target.

This is similar to NetworkManager-wait-online.service as provided by
network manager and systemd-networkd-wait-online.service as provided by
networkd.
---
 Makefile.am|  2 +-
 configure.ac   |  3 ++-
 src/connman-wait-online.service.in | 12 
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 src/connman-wait-online.service.in

diff --git a/Makefile.am b/Makefile.am
index af14dcc..3e216bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,7 +64,7 @@ endif
 if SYSTEMD
 systemdunitdir = @SYSTEMD_UNITDIR@
 
-systemdunit_DATA = src/connman.service
+systemdunit_DATA = src/connman.service src/connman-wait-online.service
 
 if VPN
 systemdunit_DATA += vpn/connman-vpn.service
diff --git a/configure.ac b/configure.ac
index 6f35c78..b4c1601 100644
--- a/configure.ac
+++ b/configure.ac
@@ -386,4 +386,5 @@ AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o 
\
 
 AC_OUTPUT(Makefile include/version.h src/connman.service
vpn/connman-vpn.service vpn/net.connman.vpn.service
-   scripts/connman connman.pc src/net.connman.service)
+   scripts/connman connman.pc src/net.connman.service
+   src/connman-wait-online.service)
diff --git a/src/connman-wait-online.service.in 
b/src/connman-wait-online.service.in
new file mode 100644
index 000..ff31496
--- /dev/null
+++ b/src/connman-wait-online.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Wait for connman to have an interface ready
+Requires=connman.service
+After=connman.service
+Before=network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=@prefix@/lib/connman/test/wait-for-ready
+
+[Install]
+WantedBy=network-online.target
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH 2/2] connman-wait-online.service.in: systemd service that waits for network

2014-10-22 Thread Patrik Flykt

Hi,

On Wed, 2014-10-22 at 11:21 +0200, Noé Rubinstein wrote:
> Create a systemd service that uses test/wait-for-ready to wait for any
> interface to be in the 'ready' or 'online' state. This service will be
> pulled by network-online.target.
> 
> This is similar to NetworkManager-wait-online.service as provided by
> network manager and systemd-networkd-wait-online.service as provided by
> networkd.
> ---
>  Makefile.am|  2 +-
>  configure.ac   |  3 ++-
>  src/connman-wait-online.service.in | 12 
>  3 files changed, 15 insertions(+), 2 deletions(-)
>  create mode 100644 src/connman-wait-online.service.in
> 
> diff --git a/Makefile.am b/Makefile.am
> index af14dcc..3e216bf 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -64,7 +64,7 @@ endif
>  if SYSTEMD
>  systemdunitdir = @SYSTEMD_UNITDIR@
>  
> -systemdunit_DATA = src/connman.service
> +systemdunit_DATA = src/connman.service src/connman-wait-online.service
>  
>  if VPN
>  systemdunit_DATA += vpn/connman-vpn.service
> diff --git a/configure.ac b/configure.ac
> index 6f35c78..b4c1601 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -386,4 +386,5 @@ AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" 
> -o \
>  
>  AC_OUTPUT(Makefile include/version.h src/connman.service
>   vpn/connman-vpn.service vpn/net.connman.vpn.service
> - scripts/connman connman.pc src/net.connman.service)
> + scripts/connman connman.pc src/net.connman.service
> + src/connman-wait-online.service)
> diff --git a/src/connman-wait-online.service.in 
> b/src/connman-wait-online.service.in
> new file mode 100644
> index 000..ff31496
> --- /dev/null
> +++ b/src/connman-wait-online.service.in
> @@ -0,0 +1,12 @@
> +[Unit]
> +Description=Wait for connman to have an interface ready
> +Requires=connman.service
> +After=connman.service
> +Before=network-online.target
> +
> +[Service]
> +Type=oneshot
> +ExecStart=@prefix@/lib/connman/test/wait-for-ready

Here (or in the previous patch, actually), I really prefer writing a
connmand-wait-ready binary in C and installing it in a proper location.
This because using connmand, connman-vpnd and connmanctl so far demands
only the required C libraries being present.

It is true that the "tests" are written in Python, but quite a few of
them are obsoleted by connmanctl and they're hanging around mostly for
historical purposes.

Cheers,

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Fwd: [PATCH 2/2] connman-wait-online.service.in: systemd service that waits for network

2014-10-23 Thread Noé RUBINSTEIN
Hi Patrik,

2014-10-22 15:14 GMT+02:00 Patrik Flykt :
> Here (or in the previous patch, actually), I really prefer writing a
> connmand-wait-ready binary in C and installing it in a proper location.
> This because using connmand, connman-vpnd and connmanctl so far demands
> only the required C libraries being present.

Would that fit as a "connmanctl wait" command?
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Fwd: [PATCH 2/2] connman-wait-online.service.in: systemd service that waits for network

2014-10-23 Thread Patrik Flykt
On Thu, 2014-10-23 at 10:23 +0200, Noé RUBINSTEIN wrote:
> Would that fit as a "connmanctl wait" command?

I'd prefer to have a small standalone binary for this so that
connnmanctl (and the wait for connection binary) can be installed
independently of each other.

Cheers,

Patrik


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman