Patch by David Johnson <davijoh3@cisco.com> to fix Debian bug #816872 [1]:
> wmbattery appears to have a memory leak. When invoked with "wmbattery -w 2"
> it is leaking approx 350KB/minute on my system. Eventually it runs out of
> memory and is killed by kernel.
...
> I've concluded libupower-glib is just super leaky. The below patch
> moves the upower API calls into a child process that doesn't exist for
> long to keep the leaks out of the main process.
> Tested against stretch versions, looks good.
[1] https://bugs.debian.org/816872
Immediately after suspend/hibernation wakup cycle, up_client_get_devices()
can fail:
libupower-glib-WARNING **: up_client_get_devices failed: Timeout was reached
Since we do not interpret the UPower signals, just don't exit wmbattery after
first up_client_get_devices() failure.