How can I wait in my user space program until connman has finished the network configuration on Linux booting? (Unfortunately, this is not Wants=connman.service.)
After systemd service connman is up, my user space program starts via systemd service (Wants=network.target connman.service), and it wants to read the network configuration via C function getifaddrs() (e.g. ifa->ifa_addr and ifa->ifa_addr->sa_family). Now two things can happen, either connman reads an explicitely unconfigured network (IPv4=0.0.0.0/0.0.0.0/0.0.0.0) or a certain network configuration (e.g. IPv4=192.168.0.50/255.255.255.0/0.0.0.0) from its config file. For some reasons my program has to wait on a certain code line until connman has finished its setup with one of both cases. How do I do that?
All I found in the systemd synchronisation possibilities were points of times when the connman service is up (Wants=connman.service) which does not mean it has processed its config file, it's before that!!!), and secondly, network-online.target for when an IP address is configured (which does not include the case of 0.0.0.0/0.0.0.0/0.0.0.0 in the connman config file).
addon: I noticed an IP address is set during Linux booting as soon as "Link is up - 100Mbps/Full - flow control off" is printed on console. How do I detect that in my user program?
Uhm, all I found is this workaround. The start script of my service looks into connman's .config file and searches for the line with "IPv4=", and in case it's all 0.0.0.0 there I can immediately start my application or otherwise I have to loop in that script until ifconfig reports it has set an IP address for that certain network adapter interface.