irqbalance: fix socket directory and create it
authorHannu Nyman <hannu.nyman@iki.fi>
Wed, 24 Jun 2020 15:20:25 +0000 (18:20 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Wed, 24 Jun 2020 15:33:39 +0000 (18:33 +0300)
Irqbalance defines /run/irqbalance dir for its socket
communication between irqbalance and its UI. /run does not exist
in OpenWrt (although it is defined by the Linux FHS), so the
socket creation fails. Although we do not compile UI and thus
the issue is not critical to us, fix the directory location.

Additionally, the creation is originally handled by a systemd
init script that we do not use.

* patch source to define dir as /var/run/irqbalance
* create the dir in the procd init script.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry-picked from 4f0c847828b)

utils/irqbalance/Makefile
utils/irqbalance/files/irqbalance.init
utils/irqbalance/patches/110-fix-runtime-socket-directory.patch [new file with mode: 0644]

index 15924e2797569c54cb5a749587327efff0008116..6f657f85014da9dc5b36e7e7cd0b1299a988184a 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=irqbalance
 PKG_VERSION:=1.6.0
-PKG_RELEASE:=9
+PKG_RELEASE:=10
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_PROTO:=git
index 638dcb39f65ae4973424495926f795da6b74b366..0f587e1580f25f788590af239b79a5ea3cca7a51 100644 (file)
@@ -16,6 +16,8 @@ start_service() {
        config_get_bool enabled irqbalance enabled 0
        [ "$enabled" -gt 0 ] || return 0
 
+       mkdir -p /var/run/irqbalance
+
        # 10 is the default
        config_get interval irqbalance interval 10
 
diff --git a/utils/irqbalance/patches/110-fix-runtime-socket-directory.patch b/utils/irqbalance/patches/110-fix-runtime-socket-directory.patch
new file mode 100644 (file)
index 0000000..6429f16
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/irqbalance.h
++++ b/irqbalance.h
+@@ -158,7 +158,7 @@ extern unsigned int log_mask;
+ #endif /* HAVE_LIBSYSTEMD */
+ #define SOCKET_PATH "irqbalance"
+-#define SOCKET_TMPFS "/run/irqbalance/"
++#define SOCKET_TMPFS "/var/run/irqbalance/"
+ #endif /* __INCLUDE_GUARD_IRQBALANCE_H_ */
+--- a/ui/irqbalance-ui.h
++++ b/ui/irqbalance-ui.h
+@@ -8,7 +8,7 @@
+ #include <glib-unix.h>
+ #define SOCKET_PATH "irqbalance"
+-#define SOCKET_TMPFS "/run/irqbalance"
++#define SOCKET_TMPFS "/var/run/irqbalance"
+ #define STATS "stats"
+ #define SET_SLEEP "settings sleep "