mirror of
https://github.com/openwrt/packages.git
synced 2026-10-14 12:06:51 +04:00
nut: move drivers to libexec
They are executables not libraries, so move the UPS drivers to /usr/libexec/nut. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
This commit is contained in:
1 parent
48a9a2bd62
commit
b0b686fe24
3 files changed
+8
-8
No files matched your search
+4
-4
@@ -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`") \
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user