Hi,
On Thu, 2015-07-02 at 08:37 +0200, Daniel Wagner wrote:
> There is a way to still solve your problem. You need to write
> your own session plugin. Within this plugin you can decided
> which Services needs to be online and which Session is assigned
> to that Service.
Yes. Session API is the way to go, and the assumption is that it
actually should work to some extent. The example policy
plugins/session_policy_local.c is file-based, if more flexibility is
needed see the link Daniel sent on how to do it via D-Bus IPC.
> > connmand –version 1.21
It seems that a bunch of Daniel's Session related patches are in 1.23.
Might be that later problems were solved in 1.23? And a really big bunch
of changes went into 1.22, so please upgrade and try again.
As the API has been stable throughout all of 1.x you should upgrade to
latest. There has been a lot of issues fixed that affect stability and
proper working of the APIs as well.
> > [General]
> > PreferredTechnologies=wifi,ethernet
This affects only ConnMan service autoconnect order, the intention is
that Session mode enables needed technologies as new Session users come
along. So this is strictly only needed should some non-session
applications need this particular ordering.
> > SingleConnectedTechnology=false
This is by default false so it need not be specified.
> > SessionMode=true
This setting does nothing since version 1.19 and should be omitted.
> > /etc/passwd
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > wifisession:x:120:132:wifisession:/home:/bin/bash
> > ethsession:x:121:133:ethsession:/home:/bin/bash
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Policy files (in /var/lib/connman/session_policy_local)
> >
> > wifisession.policy
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > [policy_wifisession]
> > uid = wifisession
> > AllowedBearers = wifi
> > RoamingPolicy = forbidden
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > ethsession.policy
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > [policy_ethsession]
> > uid = ethsession
> > AllowedBearers = ethernet
> > RoamingPolicy = forbidden
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Opened two terminals, connected with the newly created users on each one.
>
> This looks all good.
Yes.
I'm not sure RoamingPolicy is implemented, that might confuse things
(proaby not).
> > Terminal 1: wifisession user output
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > wifisession@ $ connmanctl
> > connmanctl> services
> > *AO Wired ethernet_68b599eda216_cable
> > *A HTC Portable Hotspot 61B3
> > wifi_0024d76e6c38_48544320506f727461626c6520486f7473706f742036314233_managed_psk
> > connmanctl> agent on
> > Agent registered
> > connmanctl> session connect
>
> This will trigger the autoconnect algorithm to do the magic. Note
> it is likely to ignore the session configuration completely. I can't
> remember the details without looking at the code.
If it'd work correctly, at this point wifi should be enabled due to
wifisession policy stating AllowedBearers = wifi. Upgrade to latest and
try again?
HTH,
Patrik
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman