weewx not running as daemon

71 views
Skip to first unread message

frits.s...@gmail.com

unread,
May 28, 2021, 9:45:30 PM5/28/21
to weewx-user
I have an interesting fault where weewxd runs happy in terminal mode but not as a daemon.
I'm running it on a PI 4.
Anyone able to give me some advice?
The output in syslog is as follows:
May 29 13:35:30 Snoopy weewx[12447] INFO weewx.manager: Added record 2021-05-29 13:35:00 NZST (1622252100) to database 'weewx'
May 29 13:35:31 Snoopy weewx[12447] INFO weewx.manager: Added record 2021-05-29 13:35:00 NZST (1622252100) to daily summary in 'weewx'
May 29 13:35:32 Snoopy weewx[12447] INFO weewx.restx: Wunderground-PWS: Published record 2021-05-29 13:35:00 NZST (1622252100)
May 29 13:35:33 Snoopy weewx[12447] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 2.63 seconds
May 29 13:35:34 Snoopy weewx[12447] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 0.69 seconds
May 29 13:35:34 Snoopy weewx[12447] INFO weewx.reportengine: Copied 0 files to /var/www/htdocs/weewx
May 29 13:35:34 Snoopy weewx[12447] INFO weewx.cheetahgenerator: Generated 6 files for report SmartphoneReport in 0.14 seconds
May 29 13:35:35 Snoopy weewx[12447] INFO weewx.imagegenerator: Generated 6 images for report SmartphoneReport in 0.25 seconds
May 29 13:35:35 Snoopy weewx[12447] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx/smartphone
May 29 13:35:36 Snoopy weewx[12447] INFO weewx.cheetahgenerator: Generated 14 files for report StandardReport in 1.69 seconds
May 29 13:35:37 Snoopy weewx[12447] INFO weewx.imagegenerator: Generated 12 images for report StandardReport in 0.54 seconds
May 29 13:35:37 Snoopy weewx[12447] INFO weewx.reportengine: Copied 0 files to /var/www/htdocs/weewx
May 29 13:37:47 Snoopy weewx[12447] INFO weewx.engine: Main loop exiting. Shutting engine down.
May 29 13:37:47 Snoopy weewx[12447] INFO weewx.engine: Shutting down StdReport thread
May 29 13:37:47 Snoopy weewx[12447] INFO user.interceptor: shutting down server thread
May 29 13:37:47 Snoopy weewx[12447] CRITICAL __main__: Keyboard interrupt.

vince

unread,
May 28, 2021, 9:48:05 PM5/28/21
to weewx-user
We need much more information to try to help....

frits.s...@gmail.com

unread,
May 28, 2021, 10:30:02 PM5/28/21
to weewx-user
Fair comment Vince.
Running platform: Raspberry Pi4
The debug flag in weewx.conf is set to 1
This is a new installation on PI4.

Running weewx (4.5.1) from terminal with the following command works correct with database and web pages being updated:
sudo weewxd

Running weewx as daemon with the following command gives the syslog output as above:
sudo /etc/init.d/weewx start

Cheers,
Frits.

frits.s...@gmail.com

unread,
May 28, 2021, 10:39:16 PM5/28/21
to weewx-user
Adding to my last: the syslog output is not showing anything from the startup as a daemon. It shows my termination of weewx running in a terminal session.
The terminal output at the start of the daemon is as follows:
pi@Snoopy:~ S sudo /etc/init.d/weewx start
[ ok ] Starting weewx (via systemctl): weewx.service
pi@Snoopy:~ $

Cheers,
Frits.

vince

unread,
May 28, 2021, 11:34:10 PM5/28/21
to weewx-user
You're not providing enough information and we unfortunately cannot read minds here....

Did you install with setup.py or apt ?
Which syslog are you looking at ?  On a pi you want to look at /var/log/syslog (not /var/log/messages)

You should probably be using "systemctl" for your commands ala "systemctl enable weewx", "systemctl start weewx", "systemctl status weewx".   I also found that if you do a lot of starts/stops manually with init.d startup files that systemd can get confused and weewx won't start due to the pid file that can get left around in some cases.   Sometimes you need to do multiple stops to clear systemd's brain a bit.

But you are not providing nearly enough info for people to help.

frits.s...@gmail.com

unread,
May 28, 2021, 11:35:59 PM5/28/21
to weewx-user
Trying anything that comes to mind I did a 'sudo /etc/init.d/weewx stop' and then 'sudo /etc/init.d/weewx start' and all came right!?!?!
I looked at what stop and start do differently and I think the 'stop' might remove a 'lockfile' probably /var/run/weewx.pid
I think' start-stop-daemon --start' will fail if /var/run/weewx.pid exists.

Cheers,
Frits.
Reply all
Reply to author
Forward
0 new messages