Hello, and thanks for the detailed report.
Regarding /var/run/nut - I think `systemd-tmpfiles --create` should have
taken care of this. Can you check if your tarball "package" actually
shipped a /usr/lib/tmpfiles.d/nut-common-tmpfiles.conf file, and does it
list (/var)/run/nut among the items it tracks? On the build system, would
`grep PATH= config.log` reveal anything? (I suspect the PIDPATH could be
defaulted as `(/var)/run` without the `.../nut` suffix)
Regarding run-time configurations, you did not specify a
`--sysconfdir=/etc/nut` so it defaults to using an `etc` dir under the
`--prefix` which is also defaulted in your case:
nut-scanner -qUN > /etc/nut/ups.conf
...
Mon 19 Feb 2024 03:06:21 AM UTC : OK: No more changes to reconcile between
systemd service instances and device configurations
in '/usr/local/ups/etc/ups.conf'
I wonder how it finds *something* to claim a "nutdev" configuration,
though. Is there something actually written into
/usr/local/ups/etc/ups.conf or is NUT hallucinating (sounds trendy this
year, maybe it grew an AI too?) :)
> [Do I also need: "--enable-inplace-runtime"?]
If you had a previous installation of NUT, perhaps a package, this option
helps the `configure` script auto-detect other options like paths and user
names for your new build to be a functional replacement of the old one. In
particular, this helps with testing of new program iterations right from
the build workspace using the same system-wide configs.
Jim
On Mon, Feb 19, 2024 at 4:51 AM Bruce Pleat via Nut-upsuser <
nut-upsuser@alioth-lists.debian.net> wrote:
> I'm trying to Compile/Package and then (on a different box) Config/Run
> 2.8.1. Both boxes are Raspberry Pi 4b on Bullseye with a generic USB UPS.
>
> --
>
> I'm trying to get nut running on my Raspberry (bullseye/11). (I'd also
> love to share a working 2.8.1 for Raspberry with the world, but...)
>
> I compiled the latest code from git: version 2.8.1-774-g963abbd87
> I compiled it on one system that does NOT have a UPS, to "package" for my
> three other UPS-monitoring systems.
>
> Here's the general history/steps.
>
> (Note: In some places, I did repeat prior steps in different orders, but
> did not take detailed notes of every last diagnostic effort...)
>
> (Note: Anywhere I put a semicolon, I did each command separately, but am
> simplifying here)
> (Note: For each step, I can cite where I found it if desired)
>
> [The next four are just general info, not specific to this build]
> [Installed VS Code on my RPi 4 - 8GB if relevant]
> [Changed "disable-hardware-acceleration": true]
> [Git clone: https://github.com/networkupstools/nut/]
> [Installed a bunch of VS Code plugins/addins/whatevers]
>
> [Installed desired-feature prerequisites:] [Note: I did the "configure"
> step repeatedly, looked at errors, and then "apt-get install" for needed
> items, so I did run it several times...]
> apt-get install ccache time git python perl curl make autoconf automake
> libltdl-dev libtool valgrind cppcheck pkg-config gcc g++ clan libtool-bin
> libxml2-utils xsltproc asciidoc libusb-1.0-0-dev libusb-dev libsystemd-dev
> python3-systemd
> ./autogen.sh
> ./configure
> ./configure --enable-dependency-tracking --enable-strip --with-nutconf
> --with-usb --with-nut-monitor --with-nut-scanner --with-libsystemd
> --with-doc --enable-strip --with-ssl=NO --with-openssl=NO --with-user=ups
> --with-group=nut
> [Do I also need: "--enable-inplace-runtime"?]
> make DESTDIR=/tmp/package install
> make DESTDIR=/tmp/package install-conf
> [Not sure if needed for Package system, but I did:] mkdir -p
> /var/state/ups; chmod 0770 /var/state/ups; chown root:nut /var/state/ups
> make all; make; make check; make spellcheck
> [Then, since I realized that might not be sufficient for packaging, redid
> as follows:]
> make all; make DESTDIR=/tmp/package install; make DESTDIR=/tmp/package
> install-conf; cd conf; make DESTDIR=/tmp/package install; make
> DESTDIR=/tmp/package install-conf ; make install; cd ..; make; make check
> && make spellcheck
> [Then tar -compress- it up to move to my desired "run" system]
>
> [Then, of course tar -expand- on run system]
> [On the run system]:
> useradd ups; groupadd nut
> [Also added user "ups" to group "nut":] usermod -a -G nut ups]
>
>
> mkdir -p /var/state/ups
> chmod 0770 /var/state/ups
> chown root:nut /var/state/ups
>
> [Copied man pages and reindexed, though not relevant here]
>
> [Then copied / linked from my tar folder as follows]
> cp bin/* /bin
> ln -s /usr/local/ups/etc /etc/nut
> md /lib/ups; cp lib/* /lib/ups/
> cp libexec/* /usr/libexec
> cp sbin /sbin/
> ln -s /usr/local/ups/lib /lib/ups
>
> [Configuration details...]
>
> [Why reinvent the wheel and risk a problem?]
> nut-scanner -qUN > /etc/nut/ups.conf
>
> [Configuration of /etc/nut/ups.conf becomes:]
> [nutdev-usb1]
> driver = "usbhid-ups"
> port = "auto"
> vendorid = "0764"
> productid = "0501"
> product = "SL Series"
> vendor = "CPS"
> # bus = "001"
> # device = "049"