Issue starting service after 5.0.1 upgrade

104 views
Skip to first unread message

Tony Perkins

unread,
Dec 29, 2024, 6:33:50 PM12/29/24
to weewx-user
 Hello all.  My existing longtime weewx installation on Ubuntu was upgraded to version 5.0.1 after an OS upgrade.  I've gotten parts of it working, but the service doesn't appear to start using the new systemctl method.

 I am using a serial device from a Vantage 2 Pro console. I have added weewx to the dialout group for the /dev/ttyS0 device.  I can successfully start weewxd under the weewx user using this command:  sudo runuser -u weewx weewxd

 However using 'sudo systemctl start weewx' with start, status, or restart results in an error (stop produces no output).  Only the 3 lines below are logged to syslog:
Started weewx.service - weewx weather system.
weewx.service: Main process exited, code=exited, status=1/FAILURE
weewx.service: Failed with result 'exit-code'.

I have 'debug = 1' in my /etc/weewx/weewx.conf file.  
Serial device: crw-rw---- 1 root dialout 4, 64 Dec 29 12:06 /dev/ttyS0
dialout group members:
getent group dialout
dialout:x:20:weewx

I'm not sure what the next step is here.  There's a disconnect somewhere between the service setup and running it directly, and I'd appreciate any help.  Thank you!

Tom Keffer

unread,
Dec 29, 2024, 9:23:04 PM12/29/24
to weewx...@googlegroups.com
I feel your pain. Debugging a failed systemd start can be difficult. Things to try:

1. Make sure you are using the service file that you think you are using. V5 installs in /lib/systemd/system/weewx.service. You may have another one in /etc/systemd/system/weewx.service. 

2. Along the same lines, what does "systemctl status weewx" show? It should show you using the service file /lib/systemd/system/weewx.service.

3. Make sure your service file is from V5, and not from your old installation. It will be in /lib/systemd/system/weewx.service. It should look something like this:

[Unit]

Description=WeeWX

Requires=time-sync.target

After=time-sync.target

Wants=network-online.target

After=network-online.target


[Service]

ExecStart=weewxd /etc/weewx/weewx.conf

StandardOutput=null

StandardError=journal+console

RuntimeDirectory=weewx

RuntimeDirectoryMode=775

User=weewx

Group=weewx


[Install]

WantedBy=multi-user.target


4. Make sure your unit file is valid:

sudo systemd-analyze verify weewx.service

5. Double check that there isn't anything useful in the system log:

sudo journalctl -u weewx

If none of that works, come back here with the results of the above.


--
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 visit https://groups.google.com/d/msgid/weewx-user/8d03547d-8674-4ffa-b955-57592caf60dfn%40googlegroups.com.

Tony Perkins

unread,
Dec 30, 2024, 4:11:07 PM12/30/24
to weewx-user
 Thank you for all of the detailed information!  You were correct on the first part, it was located in /etc.  I'm documenting for others to find:

sudo systemctl status weewx
Warning: The unit file, source configuration file or drop-ins of weewx.service changed on disk. Run 'systemctl da>
× weewx.service - weewx weather system
     Loaded: loaded (/etc/systemd/system/weewx.service; enabled; preset: enabled)

To invalidate that file, I just performed a gzip on the old file: gzip /etc/systemd/system/weewx.service.
Then reloaded the services config:  sudo systemctl daemon-reload

The new /lib service file is now being used, but resulted in the same error:
sudo systemctl status weewx
× weewx.service - WeeWX
     Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-12-30 02:59:01 CST; 7h ago

The way around this was needing to do a start first:
sudo systemctl start weewx

Which shows valid output in the logs:
... DEBUG weewx.drivers.vantage: Successfully woke up Vantage console ...

And status now works correctly too:
systemctl status weewx
● weewx.service - WeeWX
     Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-12-30 10:07:22 CST; 2min 10s ago
       Docs: https://weewx.com/docs
......

Thank you so much for your assistance!
Reply all
Reply to author
Forward
0 new messages