<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mqtt-notify/mqtt-notify.service, branch master</title>
<subtitle>MQTT to Desktop Notification script, for use with irssi's mqtt-notify.pl</subtitle>
<id>http://git.mattst88.com/irssi/mqtt-notify/atom/mqtt-notify.service?&amp;h=master</id>
<link rel='self' href='http://git.mattst88.com/irssi/mqtt-notify/atom/mqtt-notify.service?&amp;h=master'/>
<link rel='alternate' type='text/html' href='http://git.mattst88.com/irssi/mqtt-notify/'/>
<updated>2026-09-10T03:51:47Z</updated>
<entry>
<title>mqtt-notify: Recover from lost connections</title>
<updated>2026-09-10T03:51:47Z</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2026-09-10T03:51:47Z</published>
<link rel='alternate' type='text/html' href='http://git.mattst88.com/irssi/mqtt-notify/commit/?id=45219840a205abc11e11f86ddfc60f87f6f6ed8b'/>
<id>urn:sha1:45219840a205abc11e11f86ddfc60f87f6f6ed8b</id>
<content type='text'>
The service runs for as long as the session does, so it has to survive
laptop suspends and network changes. It did not: a connection that died
while the machine was asleep could leave the client wedged, with no way
back short of restarting the unit by hand.

Tighten the reconnect behavior and add a way out when it still fails:

  - Bound paho's reconnect backoff to 30 seconds. The default grows to
    two minutes between attempts, so even a successful reconnect could
    take minutes to happen.

  - Drop the keepalive from 60 to 30 seconds so that a connection which
    went away without a FIN is noticed sooner.

  - Track how long we have been disconnected and exit if that exceeds
    two minutes, and set Restart=always in the unit file so that systemd
    brings us back with a fresh client. CLOCK_MONOTONIC excludes time
    spent suspended, so this does not fire spuriously on resume.

Also stop calling sys.exit() from on_message(). It runs on paho's
network thread, where SystemExit only kills that thread and leaves the
main loop running with no connection. Quit the main loop instead.
</content>
</entry>
<entry>
<title>mqtt-notify.service: Set PYTHONUNBUFFERED=1</title>
<updated>2020-10-04T06:46:52Z</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2020-10-04T06:41:59Z</published>
<link rel='alternate' type='text/html' href='http://git.mattst88.com/irssi/mqtt-notify/commit/?id=faf488e04683970f912d857a99ea481808011350'/>
<id>urn:sha1:faf488e04683970f912d857a99ea481808011350</id>
<content type='text'>
This ensures that the prints appear in journald.
</content>
</entry>
<entry>
<title>Initial import</title>
<updated>2019-10-10T06:01:26Z</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2019-10-10T06:01:26Z</published>
<link rel='alternate' type='text/html' href='http://git.mattst88.com/irssi/mqtt-notify/commit/?id=d297e86f2217a7a5c1ddd66fea12c9ffa34f180e'/>
<id>urn:sha1:d297e86f2217a7a5c1ddd66fea12c9ffa34f180e</id>
<content type='text'>
</content>
</entry>
</feed>
