On Sun, 2020-08-16 at 22:42 +0300, Ionuț Leonte wrote:
Hello Thomas, Here is what the NM logs say when I start my script: Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6844] secret-agent[77a00dfcf3f32cc4]: constructed: :1.103/dev.ileonte.VPNSSO/1000, owner="ileonte" (unix-process[pid=3598, uid=1000, start=72345]), unique-name=":1.94", capabilities=vpn-hints Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <debug> [1597606476.6845] agent-manager: agent[77a00dfcf3f32cc4,:1.103/dev.ileonte.VPNSSO/1000]: requesting permissions Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6845] auth: call[318]: CheckAuthorization(org.freedesktop.NetworkManager.wifi.share.protecte d), subject=unix-process[pid=3598, uid=1000, start=72345] Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6845] auth: call[319]: CheckAuthorization(org.freedesktop.NetworkManager.wifi.share.open), subject=unix-process[pid=3598, uid=1000, start=72345] Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6846] secret-agent[77a00dfcf3f32cc4]: name-owner-changed: has :1.103 Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6854] auth: call[318]: completed: authorized=1, challenge=0 Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6858] auth: call[319]: completed: authorized=1, challenge=0 Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <info> [1597606476.6858] agent-manager: agent[77a00dfcf3f32cc4,:1.103/dev.ileonte.VPNSSO/1000]: agent registered Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <debug> [1597606476.6858] policy: re-enabling autoconnect for all connections (only clear no-secrets flag) Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6861] secret-agent[77a00dfcf3f32cc4]: name-owner-changed: disconnected Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <debug> [1597606476.6861] agent-manager: agent[77a00dfcf3f32cc4,:1.103/dev.ileonte.VPNSSO/1000]: agent unregistered or disappeared Aug 16 22:34:36 ltkcentral NetworkManager[3209]: <trace> [1597606476.6862] secret-agent[77a00dfcf3f32cc4]: finalized (hopefully gmail doesn't butcher them too badly) I'm not sure why agent-manager thinks my agent has disconnected, the script is still running, I can see my object using qdbusviewer and I can call methods on it manually.
Hi, I wouldn't think that you can still see ":1.103" connected to the bus. Did you check the system bus? I think your client drops off immediately, because nothing keeps the "proxy" instance alive (it gets destructed right away). And that holds the only reference to the GDBusConnection singleton from g_bus_get() -- the one that you request via Gio.BusType.SYSTEM. When the GDBusConnection disconnects, it disconnects from the system bus. (note that with Gio.bus_own_name(), you also (internally) end up accessing a GDBusConnection singleon, but this time it's for the Gio.BusType.SESSION bus -- anyway, bus_own_name() is unnecessary). best, Thomas
Attachment:
signature.asc
Description: This is a digitally signed message part