Discussion:
[PATCH 2/2] connman-wait-online.service.in: systemd service that waits for network
Noé Rubinstein
2014-10-22 09:21:06 UTC
Permalink
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 0000000..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
Patrik Flykt
2014-10-22 13:14:00 UTC
Permalink
Hi,
Post by 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
-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 0000000..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
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
Noé RUBINSTEIN
2014-10-23 08:23:57 UTC
Permalink
Hi Patrik,
Post by 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?
Patrik Flykt
2014-10-23 09:00:21 UTC
Permalink
Post by Noé RUBINSTEIN
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

Loading...