Hi, Greg

weewx V4 uses a new logging facility, Python's module 'logging', which
requires that one set up logging handlers. The handler "syslog" is designed
to (roughly) emulate the previous syslog logging. To set it up, you must
specify a destination (called 'address') and a 'facility', which vary from
OS to OS. I suspect that the defaults that weewx is picking for NetBSD are
wrong.

Take a look at the top of file weeutil/logger.py where these destinations
are coded in. It looks like:

if sys.platform == "darwin":
    address = '/var/run/syslog'
    facility = 'local1'
elif sys.platform.startswith('linux'):
    address = '/dev/log'
    facility = 'user'
elif sys.platform.startswith('freebsd'):
    address = '/var/run/log'
    facility = 'user'
else:
    address = ('localhost', 514)
    facility = 'user'

I don't know which branch NetBSD would take. Either 'freebsd' or the
default, I imagine. Obviously, what it's choosing isn't working out.
Perhaps you can supply an alternative for NetBSD? It may be as simple as a
different file path for 'address'.

-tk


On Sat, Mar 7, 2020 at 5:44 PM Greg Troxel <[email protected]> wrote:

> I just updated to the tip of master (plus a local commit to change
> prefix to /usr/weewx).  After installing, weewxd crashes on boot trying
> to set up the backup logger.  I am unclear on what's going on here and
> starting to read code.
>
> I wonder if there are some Linux path assumptions hard-coded in, but
> that's an unsubstantiated guess.  Does this work ok for everybody else?
>
> My system in NetBSD8, earmv7hf-el (RPI3), and has been running weewx
> 3.9.x and earlier just fine for just over 2 years.
>
> The system does have working syslog, and lines have been appearing in
> /var/log/messages via syslog, when I was running 3.9.2:
>
>   Mar  7 20:25:28 wx weewx[1249]: rsyncupload: rsync'd 17 files (83,033
> bytes) in 0.82 seconds
>   Mar  7 20:30:14 wx weewx[1249]: engine: Main loop exiting. Shutting
> engine down.
>   Mar  7 20:30:14 wx weewx[1249]: engine: Shutting down StdReport thread
>   Mar  7 20:30:15 wx weewx[1249]: engine: Terminating weewx version 3.9.2
>
> The crash looks like:
>
>   $ bin/weewxd
>   Traceback (most recent call last):
>     File "bin/weewxd", line 261, in <module>
>       main()
>     File "bin/weewxd", line 80, in main
>       weeutil.logger.setup(options.log_label, {})
>     File "/usr/home/gdt/SOFTWARE/WEEWX/weewx/bin/weeutil/logger.py", line
> 148, in setup
>       logging.config.dictConfig(log_dict)
>     File "/usr/pkg/lib/python2.7/logging/config.py", line 794, in
> dictConfig
>       dictConfigClass(config).configure()
>     File "/usr/pkg/lib/python2.7/logging/config.py", line 576, in configure
>       '%r: %s' % (name, e))
>   ValueError: Unable to configure handler 'syslog': [Errno 2] No such file
> or directory
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/rmiwo7v1uzc.fsf%40s1.lexort.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEBa%3DcnV8TZRb%2BQoB%2BVsmSP30y9LHzo5FiC4jVLXa8Es_w%40mail.gmail.com.

Reply via email to