]> git.99rst.org Git - openwrt-packages.git/commitdiff
nut: move drivers to libexec
authorDaniel F. Dickinson <redacted>
Sun, 10 May 2026 02:33:24 +0000 (22:33 -0400)
committerJosef Schlehofer <redacted>
Thu, 2 Jul 2026 04:43:08 +0000 (06:43 +0200)
They are executables not libraries, so move the UPS drivers
to /usr/libexec/nut.

Signed-off-by: Daniel F. Dickinson <redacted>
net/nut/Makefile
net/nut/files/nut-server.init
net/nut/files/nutshutdown

index 3946ad370ee3cb80228ec2f823770f63bfe9e9e3..58643b458bd7eab1efb0e9852f61b577564b3714 100644 (file)
@@ -383,9 +383,9 @@ define DriverPackage
 
         endef
         define Package/nut-driver-$(2)/install
-               $(INSTALL_DIR) $$(1)/lib/nut
-               $(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2) $$(1)/lib/nut/
-               $(if $(filter $(2),clone),$(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2)-outlet $$(1)/lib/nut/)
+               $(INSTALL_DIR) $$(1)/usr/libexec/nut
+               $(CP) $$(PKG_INSTALL_DIR)/usr/libexec/nut/$(2) $$(1)/usr/libexec/nut/
+               $(if $(filter $(2),clone),$(CP) $$(PKG_INSTALL_DIR)/usr/libexec/nut/$(2)-outlet $$(1)/usr/libexec/nut/)
         endef
 endef
 define DriverDescription
@@ -582,7 +582,7 @@ CONFIGURE_ARGS += \
        --without-nut_monitor \
        --with-statepath=/var/run/nut \
        --with-pidpath=/var/run \
-       --with-drvpath=/lib/nut \
+       --with-drvpath=/usr/libexec/nut \
        --with-user=nut \
        --with-group=nut \
        $(if $(CONFIG_PACKAGE_nut-web-cgi),--with-gd-includes="`pkg-config --cflags gdlib`") \
index be1cd45e20a5caa9fed96de42c5443f70901bc6a..e62a3c364f02b39dc07b762570251ba57cbfc19e 100755 (executable)
@@ -368,7 +368,7 @@ start_ups_driver() {
        procd_set_param stdout 0 # Subset of stderr
        procd_set_param env NUT_QUIET_INIT_UPSNOTIFY=true
        procd_set_param env NUT_STATEPATH="${STATEPATH}"
-       procd_set_param command /lib/nut/"${driver}" -FF -a "$ups" ${RUNAS:+-u "$RUNAS"}
+       procd_set_param command /usr/libexec/nut/"${driver}" -FF -a "$ups" ${RUNAS:+-u "$RUNAS"}
        procd_close_instance
        haveupscfg=1
 }
@@ -516,7 +516,7 @@ stop_ups_driver() {
        config_get driver "$ups" driver "usbhid-ups"
 
        if procd_running nut-server "$ups"; then
-               signal_instance "$ups" "$driver" "/lib/nut/'${driver}' -c exit -a '${ups}'" "TERM" "${STATEPATH}/${driver}-${ups}.pid"
+               signal_instance "$ups" "$driver" "/usr/libexec/nut/'${driver}' -c exit -a '${ups}'" "TERM" "${STATEPATH}/${driver}-${ups}.pid"
                if procd_running nut-server upsd >/dev/null 2>&1; then
                        signal_instance upsd upsd "upsd -c stop" "TERM" "${STATEPATH}/upsd.pid" "procd_kill nut-server upsd"
                fi
@@ -546,7 +546,7 @@ reload_ups_driver() {
 
        # Try to reload, otherwise exit politely, then stop and restart procd instance
        if procd_running nut-server "$ups"; then
-               signal_instance "$ups" "$driver" "/lib/nut/'${driver}' -c reload-or-exit -a '${ups}'" HUP "${STATEPATH}/${driver}-${ups}.pid"
+               signal_instance "$ups" "$driver" "/usr/libexec/nut/'${driver}' -c reload-or-exit -a '${ups}'" HUP "${STATEPATH}/${driver}-${ups}.pid"
        fi
        /etc/init.d/nut-server start "$ups" 2>&1 | logger -t nut-server
 }
index 7270f983f1088e90b72dae4ca00e2e8dd9bc4370..f8115270465f9d7d9308bb09a7baeefc4621ea15 100755 (executable)
@@ -14,7 +14,7 @@ shutdown_instance() {
 
        # Only FSD if killpower was indicated
        if [ -f /var/run/killpower ]; then
-               /lib/nut/"${driver}" -a "$cfg" -k
+               /usr/libexec/nut/"${driver}" -a "$cfg" -k
        fi
 }
 
git clone https://git.99rst.org/PROJECT