Discussion:
connman and cmcc: howto check if connman is started
Stephan Raue
2010-09-23 12:21:11 UTC
Permalink
Hi,

i use connman and on top of this cmcc from indicator-network package to
setup connman. connman will be started from init script and will be
setup with the same init script via cmcc. after connman is started cmcc
fails because connman is not up. is it possible in any way (in an shell
init script) to check if connman is ready with starting to setup
connman? i dont want use sleep or anything

greetings

Stephan
--
### OpenELEC.tv ###
The free and open Mediacenter Distribution 4 you
http://www.openelec.tv
Kalle Valo
2010-09-23 12:34:36 UTC
Permalink
Post by Stephan Raue
Hi,
Hi Stephan,
Post by Stephan Raue
i use connman and on top of this cmcc from indicator-network package
to setup connman.
Ok, so these are ubuntu packages.
Post by Stephan Raue
connman will be started from init script
I assume you are using recent connman ubuntu packages which use upstart
(ie. you have a file /etc/init/connman.conf).
Post by Stephan Raue
and will be setup with the same init script via cmcc.
Sorry, I don't understand this sentence. Can you elaborate, please?

And why do you want to run cmcc on boot? That doesn't sound right to me.
Post by Stephan Raue
after connman is started cmcc fails because connman is not up. is it
possible in any way (in an shell init script) to check if connman is
ready with starting to setup connman? i dont want use sleep or
anything
In principle upstart supports this with the "start on" stanza:

http://upstart.ubuntu.com/wiki/Stanzas

But first I would like to go backwards a bit and understand the real
problem you are trying to solve. Most probably there is a better way
than running than cmcc after connmand has started.
--
Kalle Valo
Stephan Raue
2010-09-24 08:52:16 UTC
Permalink
Hi Kalle,
Post by Kalle Valo
Post by Stephan Raue
i use connman and on top of this cmcc from indicator-network package
to setup connman.
Ok, so these are ubuntu packages.
Post by Stephan Raue
connman will be started from init script
I assume you are using recent connman ubuntu packages which use upstart
(ie. you have a file /etc/init/connman.conf).
Post by Stephan Raue
and will be setup with the same init script via cmcc.
Sorry, I don't understand this sentence. Can you elaborate, please?
And why do you want to run cmcc on boot? That doesn't sound right to me.
Post by Stephan Raue
after connman is started cmcc fails because connman is not up. is it
possible in any way (in an shell init script) to check if connman is
ready with starting to setup connman? i dont want use sleep or
anything
http://upstart.ubuntu.com/wiki/Stanzas
But first I would like to go backwards a bit and understand the real
problem you are trying to solve. Most probably there is a better way
than running than cmcc after connmand has started.
yes but i dont use ubuntu. to explain a bit more, i have created an
small embedded distribution and want use connman for networking. now i
need an solution to setup connman from my shell based init scripts for
static and wlan config (the config is stored in an config file). i have
found your cmcc script inside the indicator-network package and it works
great (this time only for wired networks).

to see how i want use this look here:
for the initial configfile:
http://openelec.git.sourceforge.net/git/gitweb.cgi?p=openelec/openelec;a=blob;f=packages/network/connman/config/network.conf
for the init script:
http://openelec.git.sourceforge.net/git/gitweb.cgi?p=openelec/openelec;a=blob;f=packages/network/connman/init.d/13_network

now the problem is, that cmcc will be run directly after starting
connman, and this fails, because connman is not ready with startup so i
must use an sleep or usleep.

Stephan
--
### OpenELEC.tv ###
The free and open Mediacenter Distribution 4 you
http://www.openelec.tv
Pekka Pessi
2010-09-24 12:14:35 UTC
Permalink
Hi Stephan,
yes but i dont use ubuntu. to explain a bit more, i have created an small
embedded distribution and want use connman for networking. now i need an
solution to setup connman from my shell based init scripts for static and
wlan config (the config is stored in an config file). i have found your cmcc
script inside the indicator-network package and it works great (this time
only for wired networks).
You could create a simple program that waits until a certain bus name
is visible in system or session bus. I believe that would be very
useful for Ubuntu, too. (They might even have one already).
--
Pekka.Pessi mail at nokia.com
Kalle Valo
2010-09-27 07:33:28 UTC
Permalink
Post by Stephan Raue
yes but i dont use ubuntu. to explain a bit more, i have created an
small embedded distribution and want use connman for networking. now i
need an solution to setup connman from my shell based init scripts for
static and wlan config (the config is stored in an config file). i
have found your cmcc script inside the indicator-network package and
it works great (this time only for wired networks).
http://openelec.git.sourceforge.net/git/gitweb.cgi?p=openelec/openelec;a=blob;f=packages/network/connman/config/network.conf
http://openelec.git.sourceforge.net/git/gitweb.cgi?p=openelec/openelec;a=blob;f=packages/network/connman/init.d/13_network
now the problem is, that cmcc will be run directly after starting
connman, and this fails, because connman is not ready with startup so
i must use an sleep or usleep.
Ok, now I understand the problem. Can't you just have the settings in
connman? It makes it difficult that now you have network settings in two
different places, both in network.conf and inside connman.

But to solve your problem I think one option is to make cmcc wait for
org.moblin.connman interface to appear on the bus. So it would need to
wait for this signal:

signal sender=org.freedesktop.DBus -> dest=(null destination) serial=16 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string "org.moblin.connman"
string ""
string ":1.50"
--
Kalle Valo
Loading...