running weewx directly and as daemon

79 views
Skip to first unread message

brisguy foo

unread,
Aug 2, 2020, 5:03:12 PM8/2/20
to weewx-user
I had to do some debugging og my weewx installation recently and needed to swap back and forth between running directly and as a daemon. However, once I used the direct method, I never seem to be able to get the daemon launched again without just doing a reboot.

I have been doing the following (starting from a running daemon)
sudo /etc/init.d/weewx stop  # to stop the daemon
sudo weewxd /etc/weewx/weewx.conf  # to run directly
CTL-C   # to stop running directly
sudo /etc/init.d/weewx start  # to start the daemon

After the attempt to start the daemon, the terminal responds [OK], but looking at the syslog file, I can see it never did and there is no error message. At this point, I reboot and things run fine.

What is the correct way to start/stop these processes?

Tom Keffer

unread,
Aug 2, 2020, 5:06:22 PM8/2/20
to weewx-user
Depends on the operating system, but you have the general idea.

You may not think there is anything useful in the log, but please humor me: post it anyway. And, tell us the operating system.

--
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/da07f3e0-1205-4d15-94ce-9b2eb28a8ec3o%40googlegroups.com.

brisguy foo

unread,
Aug 2, 2020, 11:25:24 PM8/2/20
to weewx-user

Oh. I just assumed I was starting/stopping things incorrectly, so did not think a log was relevant. No problem, here it is, along with some more info.

HW = RaspberryPi Zero
OS = Raspbian 10.1

In the log, the switching between direct a daemon execution starts around 10:15 which is when I finally successfully installed version 4.1.1. It looks like I killed the daemon around 10:15 and fixed an error in the .conf file and started directly. Then stopped that and tried to start the daemon. You will see a reboot eventually after that, at which point everything works. At some point, I also changed the conf debug setting from zero to 1.

Thanks!

On Sunday, August 2, 2020 at 2:06:22 PM UTC-7, Tom Keffer wrote:
Depends on the operating system, but you have the general idea.

You may not think there is anything useful in the log, but please humor me: post it anyway. And, tell us the operating system.

On Sun, Aug 2, 2020 at 2:03 PM brisguy foo <iams...@gmail.com> wrote:
I had to do some debugging og my weewx installation recently and needed to swap back and forth between running directly and as a daemon. However, once I used the direct method, I never seem to be able to get the daemon launched again without just doing a reboot.

I have been doing the following (starting from a running daemon)
sudo /etc/init.d/weewx stop  # to stop the daemon
sudo weewxd /etc/weewx/weewx.conf  # to run directly
CTL-C   # to stop running directly
sudo /etc/init.d/weewx start  # to start the daemon

After the attempt to start the daemon, the terminal responds [OK], but looking at the syslog file, I can see it never did and there is no error message. At this point, I reboot and things run fine.

What is the correct way to start/stop these processes?

--
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...@googlegroups.com.
syslog

Tom Keffer

unread,
Aug 3, 2020, 8:40:22 AM8/3/20
to weewx-user
It's hard for me to unravel what's happening. The only thing i can suggest is to use systemctl. Seems to work for me:

sudo systemctl start weewx

Sorry, but I don't have any insights.

-tk

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/77e7e690-ca57-41b5-9b22-4b82638e7070o%40googlegroups.com.

vince

unread,
Aug 3, 2020, 11:37:33 AM8/3/20
to weewx-user
On Sunday, August 2, 2020 at 8:25:24 PM UTC-7, brisguy foo wrote:
In the log, the switching between direct a daemon execution starts around 10:15 which is when I finally successfully installed version 4.1.1. It looks like I killed the daemon around 10:15 and fixed an error in the .conf file and started directly. Then stopped that and tried to start the daemon. You will see a reboot eventually after that, at which point everything works. At some point, I also changed the conf debug setting from zero to 1.


I guess I'm missing what you see in the log that leads you to think it didn't shut down.

Try a test.....do a 'sudo systemctl stop weewx' and see what it says....then do 'sudo systemctl status weewx'....then do "ps aux | grep weewx" and see if there are any processes actually running

brisguy foo

unread,
Aug 3, 2020, 2:58:11 PM8/3/20
to weewx-user
My original complaint was that I could not get the daemon to START without rebooting the system. I never mentioned problems with shutting it down. If you look at the log starting around 10:47, you'll see messages indicating that weewx has started, but it should have posted a new record at 11:50 (and every five minutes thereafter), but did not. Same thing starting at 11:27. At that point, I reboot so I can mount a USB drive onto the system, which involves disconnecting the weather-station since I only have one USB port I can use! After that reboot, the system ran normally.

Anyway, if I am using the correct commands, I'm fine. I may try running more tests using the 'systemctl' on the command line when starting the daemon.

vince

unread,
Aug 3, 2020, 5:14:01 PM8/3/20
to weewx-user
On Monday, August 3, 2020 at 11:58:11 AM UTC-7, brisguy foo wrote:
My original complaint was that I could not get the daemon to START without rebooting the system. I never mentioned problems with shutting it down. If you look at the log starting around 10:47, you'll see messages indicating that weewx has started, but it should have posted a new record at 11:50 (and every five minutes thereafter), but did not. Same thing starting at 11:27. At that point, I reboot so I can mount a USB drive onto the system, which involves disconnecting the weather-station since I only have one USB port I can use! After that reboot, the system ran normally.



I have no idea what a USB drive has to do with anything you're mentioning.

10:54:27 your clock synched so after that we should be able to trust the timestamps in the syslog

11:17:25 weewx start
11:18:24 weewx stop

11:18:35 weewx start
(no visible weewx stop)

11:27:40 weewx start
(no visible weewx stop)

11:41:01 looks like you rebooted
11:41:37 system coming back up after reboot

11:41:48 weewx start

I'd suggest a couple things....
  • if you have to do things with USB, you likely don't have enough power being supplied to the pi.  See if you have a stronger power supply to use.
  • set debug=1 in weewx.conf so it logs more verbosely, at least until things stabilize
  • you're not showing us any weewx activity re: archiving, running skins, etc.  Check if it's going to a different file in /var/log on your pi.

Reply all
Reply to author
Forward
0 new messages