From: Mark Wooding Date: Sat, 15 May 2010 18:29:06 +0000 (+0100) Subject: svc/conntrack.in: Keep the D-Bus monitor alive. X-Git-Tag: 1.0.0pre8.1~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/29807d891d99bb0eeacce0677cf68d1d4d118a30 svc/conntrack.in: Keep the D-Bus monitor alive. Turns out nothing actually tried to keep the monitor alive. After a (rather random) interval, the bus just got dropped and we didn't get any more notifications from anyone. Stash it in a global variable. --- diff --git a/svc/conntrack.in b/svc/conntrack.in index eabdc2b1..18e2f730 100644 --- a/svc/conntrack.in +++ b/svc/conntrack.in @@ -457,12 +457,13 @@ def init(): Add the D-Bus monitor here, because we might send commands off immediately, and we want to make sure the server connection is up. """ + global DBM T.Coroutine(kickpeers, name = 'kickpeers').switch() - dbm = DBusMonitor() - dbm.addmon(NetworkManagerMonitor()) - dbm.addmon(MaemoICdMonitor()) - G.timeout_add_seconds(300, lambda: (netupdown(True, ['interval-timer']) - or True)) + DBM = DBusMonitor() + DBM.addmon(NetworkManagerMonitor()) + DBM.addmon(MaemoICdMonitor()) + G.timeout_add_seconds(30, lambda: (netupdown(True, ['interval-timer']) + or True)) def parse_options(): """