weewx writing too much to systemd journal

136 views
Skip to first unread message

Cat22

unread,
Mar 2, 2022, 10:49:42 AM3/2/22
to weewx-user
debug=0 but weewx writes over a thousand lines to the systemd journal. Its writing the data it read from the Vantage Pro II mostly LOOP:  lines. I would rather it didn't do that. None of it is error data.
Any idea how to prevent it?

Tom Keffer

unread,
Mar 2, 2022, 10:55:54 AM3/2/22
to weewx-user
Just set option log_success to False.

On Wed, Mar 2, 2022 at 7:50 AM Cat22 <erben...@gmail.com> wrote:
debug=0 but weewx writes over a thousand lines to the systemd journal. Its writing the data it read from the Vantage Pro II mostly LOOP:  lines. I would rather it didn't do that. None of it is error data.
Any idea how to prevent it?

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/7f3c7019-ea57-40c6-a6f0-c0799b8a5ce7n%40googlegroups.com.

Cat22

unread,
Mar 2, 2022, 11:13:33 AM3/2/22
to weewx-user
I just tried  log_success = False in weewx.conf and restarted weewx but its still doing it
# systemctl status weewx   
weewx.service - weewx 4.0.0 weather system
    Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor preset: disabled)
    Active: active (running) since Wed 2022-03-02 08:02:23 PST; 2min 44s ago
  Main PID: 24371 (python)
     Tasks: 4 (limit: 4915)
    CGroup: /system.slice/weewx.service
            └─24371 python /usr/local/bin/weewx/bin/weewxd /usr/local/bin/weewx/weewx.conf
Sample of lines logged
Mar 02 08:04:44 pc2 weewxd[24371]: LOOP:   2022-03-02 08:04:41 PST (1646237081) altimeter:  etc etc the line is very long
Mar 02 08:04:44 pc2 weewxd[24371]: LOOP:   2022-03-02 08:04:43 PST (1646237083) altimeter:  etc etc

Tom Keffer

unread,
Mar 2, 2022, 11:15:48 AM3/2/22
to weewx-user
Thanks, i just tried that and restarted wewx but it's still printing that loop data.

I'm not sure what you mean by "printing that loop data." Are we talking about the log? Or, printing to a console through standard output?

If the former, the Vantage driver logs no data in the system log --- only control information. StdArchive does log successful and unsuccessful insertions into the database, but these should be controlled by log_success and log_failure, respectively, at least on modern versions of WeeWX (what version are you using?).

If the latter (printing to the console), then you shouldn't see this if you are running weewxd as a daemon.

Perhaps an excerpt of the log so we can see what you're concerned about?

Tom Keffer

unread,
Mar 2, 2022, 11:17:02 AM3/2/22
to weewx-user
Oh, just saw the excerpt you posted. Looks like you forgot the --daemon flag in the command line.

Cat22

unread,
Mar 2, 2022, 11:20:32 AM3/2/22
to weewx-user
weewx version 4.0.0
I am having trouble posting here, my posts seem to just disappear. Hopefully this one will make it.
I found log_success in 2 places in weewx.conf I set that to False also, but it doesnt make a bit of differrence

Here is a sample:
Mar 02 08:18:20 pc2 weewxd[14910]: LOOP:   2022-03-02 08:18:19 PST (1646237899) altimeter etc etc, the line is very long

Cat22

unread,
Mar 2, 2022, 11:23:51 AM3/2/22
to weewx-user
I thought systemd asked services not to demonize as systemd does that for them. Ami right about this?
However, I will try it.

Cat22

unread,
Mar 2, 2022, 11:30:30 AM3/2/22
to weewx-user
Seems like the --daemon option fixed things
my service file looks like this (in part()
[Service]                                                                                                                                                                                                                                
ExecStart=/usr/local/bin/weewx/bin/weewxd /usr/local/bin/weewx/weewx.conf --daemon                                                                                                                                                       
ExecReload=/usr/bin/killall -TERM $MAINPID                                                                                                                                                                                               
Type=simple                                                                                                                                                                                                                              
Restart=on-failure                                                                                                                                                                                                                       
RestartSec=100s     

Good grief this google thing here is hard to use!

ok, i just checked before posting and weewx crashed  -  it never does tthat but the --daemon opt was the only thing that changed

Tom Keffer

unread,
Mar 2, 2022, 11:47:31 AM3/2/22
to weewx-user
"weewx crashed" doesn't give us very much information. 

There are other command line flags that are normally used in a systemd file.

Why not use the weewx.service that comes with WeeWX? It's in the util/systemd directory. Modify as required.

Cat22

unread,
Mar 2, 2022, 12:04:04 PM3/2/22
to weewx-user
That's basically what i did. When i add --daemon and restart i see this:
Mar 02 08:53:52 pc2 systemd[1]: weewx.service: Current command vanished from the unit file, execution of the command list won't be resumed.
followed by some weather data then this:
Mar 02 08:54:10 pc2 python[16601]: weewx[16601] INFO __main__: Initializing weewx version 4.0.0
Mar 02 08:54:10 pc2 python[16601]: weewx[16601] INFO __main__: Using Python 3.8.8 (default, Feb 19 2021, 16:53:21) [GCC]
Mar 02 08:54:10 pc2 python[16601]: weewx[16601] INFO __main__: Platform Linux-5.8.11-x86_64-with-glibc2.2.5
Mar 02 08:54:10 pc2 python[16601]: weewx[16601] INFO __main__: Locale is 'en_US.UTF-8'
Mar 02 08:54:10 pc2 python[16601]: weewx[16601] INFO __main__: PID file is /var/run/weewx.pid
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] INFO __main__: Using configuration file /usr/local/bin/weewx/weewx.conf
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] INFO __main__: Received signal TERM (15).
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] ERROR weewx.engine: Import of driver failed:  (<class '__main__.Terminate'>)
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/local/bin/weewx/bin/weewx/engine.py", line 103, in setupStation
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/local/bin/weewx/bin/weewx/drivers/vantage.py", line 39, in loader
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      return VantageService(engine, config_dict)
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/local/bin/weewx/bin/weewx/drivers/vantage.py", line 1897, in __init__
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/local/bin/weewx/bin/weewx/drivers/vantage.py", line 511, in __init__
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      self.port.openPort()
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/local/bin/weewx/bin/weewx/drivers/vantage.py", line 305, in openPort
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      import serial
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/lib/python3.8/site-packages/serial/__init__.py", line 14, in <module>
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      from serial.serialutil import *
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "<frozen importlib._bootstrap>", line 562, in module_from_spec
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "<frozen importlib._bootstrap>", line 481, in _init_module_attrs
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****    File "/usr/local/bin/weewx/bin/weewxd", line 257, in sigTERMhandler
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****      raise Terminate
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL weewx.engine:     ****  Terminate
Mar 02 08:54:10 pc2 python[16604]: weewx[16604] CRITICAL __main__: Unable to load driver:

Tom Keffer

unread,
Mar 2, 2022, 12:24:26 PM3/2/22
to weewx-user
That's basically what i did.

You didn't have the --pidfile flag before, but now it seems that you've added it. That's good, but you still have "Type=simple", while what you want is "Type=forking". Really, you should just start with the weewx.service file that came with your copy of WeeWX.

Speaking of which, I'm just now realizing that log_success was not honored by v4.0.0. That came in with V4.5.0. So, you should upgrade. But I don't think this is related to your problem below.
This may be a bad install of the python library "serial". 

Try this:

python3 -c "import serial" 

See if that crashes. Also, upgrade!

-tk

Cat22

unread,
Mar 2, 2022, 12:26:20 PM3/2/22
to weewx-user
I made this change and it worked! At least it looks like it worked, I need to watch it for awhile to be sure
#report_services = weewx.engine.StdPrint, weewx.engine.StdReport, user.lowBattery.BatteryAlarm
report_services = weewx.engine.StdReport, user.lowBattery.BatteryAlarm

Cat22

unread,
Mar 2, 2022, 12:28:10 PM3/2/22
to weewx-user
python3 -c "import serial"
that works, return code is 0 (echo $?)

Tom Keffer

unread,
Mar 2, 2022, 12:52:33 PM3/2/22
to weewx-user
I'm glad things are working, but just for my edification, what did we fix? I thought the --daemon flag fixed the problem of LOOP packet data appearing in the log. Why was it necessary to comment out StdPrint?

And, what fixed the problem with the importation of "serial"?

Cat22

unread,
Mar 2, 2022, 1:08:04 PM3/2/22
to weewx-user
I was mistaken, when i use --daemon it crashes - always
The import serial thing, i did that on the cmd line.
I removed StdPrint and --daemon and it works without excess logging
I am in the process of upgrading to 4.7 now

Cat22

unread,
Mar 5, 2022, 1:32:14 PM3/5/22
to weewx-user
Now I am running 4.7.0 and still log_success = false works and I can enable StdPrint and I am still good to go
I updated the service file:
[Unit]
Description=weewx weather system
Requires=time-sync.target
After=time-sync.target

[Service]
ExecStart=/usr/local/bin/weewx/bin/weewxd --daemon --pidfile=/var/run/weewx.pid   /usr/local/bin/weewx/weewx.conf
ExecReload=/usr/bin/killall -TERM $MAINPID
Type=forking
PIDFile=/var/run/weewx.pid
Restart=on-failure
RestartSec=100s

[Install]
WantedBy=multi-user.target

and it starts and runs great# /usr/local/bin/weewx/bin/weewxd --version
4.7.0
But i still have StdPrint disabled

I will let it run and check back after an hour or so to be sure it is still quiet, but I think it will be
Reply all
Reply to author
Forward
0 new messages