"Daemon not installed" after upgrade to 5.0.0

171 views
Skip to first unread message

Patrick Shoemaker

unread,
Jan 15, 2024, 4:14:28 PM1/15/24
to weewx-user
Hi all, I have a weewx installation on an Ubuntu 20.04.6 LTS box that was installed via apt using the weewx official repo. I upgraded from v4.x to 5.0.0 and am no longer able to get the weewx process to start. When manually attempting to start weewxd from the command line (as root), I receive the following:

The weewx daemon is not installed at /usr/share/weewx/weewxd

Permissions for that file are as follows:

in /usr/share/weewx:
-rw-r--r--   1 root root 10425 Jan 14 11:38 weewxd.py

I see in the release notes that weewx is now intended to run under the weewx user and group. I do not see this group in my /etc/group file and it looks like all the weewx files are still owned by root:root. 

Did the installer miss something here converting to the new user/group configuration or should I be looking somewhere else to get weewx (and weectl, etc.) to run properly?

Thanks!

Patrick

matthew wall

unread,
Jan 15, 2024, 4:33:57 PM1/15/24
to weewx-user
On Monday, January 15, 2024 at 4:14:28 PM UTC-5 psw...@pswired.com wrote:
Hi all, I have a weewx installation on an Ubuntu 20.04.6 LTS box that was installed via apt using the weewx official repo. I upgraded from v4.x to 5.0.0 and am no longer able to get the weewx process to start. When manually attempting to start weewxd from the command line (as root), I receive the following:

The weewx daemon is not installed at /usr/share/weewx/weewxd

your init script is looking in the wrong place.  there are two ways to fix this:
1) delete the init script.  the upgrade should have installed a systemd unit file.  the unit file *should* have precedence over the old init script, but for some reason that is not happening on your system.  are you using the standard /etc/init.d/weewx script, or are you using some other script?

2) adjust the init script or (preferably) the file /etc/default/weewx so that it points to the correct entry point.  there should be a file /usr/bin/weewxd and /usr/bin/weectl that simply exec 'python /usr/share/weewx/weewxd.py'.  if you want to keep your old init script, change it so that it invokes /usr/bin/weewxd.  (those scripts use values from /etc/default/weewx)
 
I see in the release notes that weewx is now intended to run under the weewx user and group. I do not see this group in my /etc/group file and it looks like all the weewx files are still owned by root:root. 

an upgrade should run weewx as the user it ran before the upgrade.  so in your case, unless you changed something, it should run as root.  (the user identity is determined based on the ownership of /var/lib/weewx)
 
Did the installer miss something here converting to the new user/group configuration or should I be looking somewhere else to get weewx (and weectl, etc.) to run properly?

it would be nice to know what happened.  could you post the output from dpkg/apt?  that should tell us

Patrick Shoemaker

unread,
Jan 16, 2024, 3:44:02 PM1/16/24
to weewx-user
Matthew,

Thank you, this is pointing me in the right direction. I left out a key piece of information, which is that I had a weewx-multi configuration with two config files, two databases, etc. It appears that my systemd unit files and the /etc/default/weewx and /etc/default/weewx-multi files were not touched during the upgrade. I replaced these files with the ones found in the v5.0.0 source tarball (and modified with my user/group and config file names, etc.).

I'm now able to successfully run weectl and weewx from the command line! However I can't get the daemons to start using systemd. It appears the variables WEEWX_PYTHON, WEEWX, etc. used in the systemd unit file are not defined. Can you help me understand where/when these are defined and where I should be looking to set them properly?

Thanks for your help.

Also, this has given me a chance to poke around the codebase and look through the documentation. This is a really well documented piece of software.

Patrick

matthew wall

unread,
Jan 16, 2024, 5:57:47 PM1/16/24
to weewx-user
patrick,

i would get rid of your old init.d and unit files.  then the new units that came with v5 will just work.

something like this (make copies of the files before you rm, if you like):

sudo update-rc.d weewx-multi remove
sudo rm -f /etc/init.d/weewx-multi
sudo rm -f /etc/default/weewx-multi   (do not delete /etc/default/weewx)
sudo rm /etc/systemd/system/weewx*

be sure that the values in /etc/default/weewx are correct.  for a systemd install, this is all you need:

WEEWX_PYTHON=python3
WEEWX_BINDIR=/usr/share/weewx

other entries that you might have there are used by the sysv script.  the systemd units are hard-coded (because systemd environment handling and too many systemd changes to bother tracking), so /etc/default/weewx is used only to fill in the entry point stubs /usr/bin/weewxd and /usr/bin/weectl

then, since you are using systemd, you can just follow the instructions on the wiki:



matthew wall

unread,
Jan 16, 2024, 6:01:13 PM1/16/24
to weewx-user
the v5 installer puts unit files in /usr/lib/systemd/system (or /lib/systemd/system - depends on the operating system)

this is correct behavior

when you do a pip install, or if you want to override a deb/rpm unit, then you put your stuff in /etc/systemd/system

this is the way :)

there is also a place for end-user systemd units, but they are kinda pointless for weewx, since they shutdown when you log out

Patrick Shoemaker

unread,
Jan 16, 2024, 6:43:59 PM1/16/24
to weewx-user
Matthew, perfect, everything is working now. I misunderstood the unit file structure and the intended way of doing things according to the wiki is much cleaner. All good to go now!

Thanks again.

Patrick

Reply all
Reply to author
Forward
0 new messages