openenergymonitor / emonhub

Python service linking and decoding input to MQTT & Emoncms
90 stars 83 forks source link

Allow emonhub to run on systems without /opt/.../available.conf #186

Open dconlon opened 1 year ago

dconlon commented 1 year ago

emonhub tries to load available.conf from the fixed path /opt/openenergymonitor/emonhub/conf/available.conf even when autoconf = 0, resulting in an error being logged and sys.exit being called. sys.exit exits the main thread but not the emonhub process leaving the interfacer threads running without any main thread to transfer packets over the message bus between them.

These commits attempt to load available.conf only when autoconf is enabled and where autoconf is enabled and available.conf cannot be loaded ensures the whole process exits.

mnbf9rca commented 1 year ago

thanks for this - it fixed emonhub for me!