aboutsummaryrefslogtreecommitdiff
path: root/utils/irqbalance/files/irqbalance.init
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2019-06-02 12:29:17 +0300
committerHannu Nyman <hannu.nyman@iki.fi>2019-06-02 12:43:08 +0300
commit982c389732d2d0589d15cfc1835e289275140c8c (patch)
treeae2c712cec5c5b0d45e66efc8fb07ed85a8b9c4d /utils/irqbalance/files/irqbalance.init
parentdf14fa949ff49a7c16ac8ac230c0947fb38cc113 (diff)
irqbalance: add support for uci config
Add support for uci config file. Only a global 'enabled" switch has been implemented so far. * Default config disables irqbalance initially, so that there is no change with the previous behaviour (and the possibly existing separate launch scripts in people's builds). Config file and init script can be later extended for irqbalance options like the oneshot mode or the evaluation interval (Also change the init file to use tabs) Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'utils/irqbalance/files/irqbalance.init')
-rw-r--r--utils/irqbalance/files/irqbalance.init13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/irqbalance/files/irqbalance.init b/utils/irqbalance/files/irqbalance.init
index 34db0a23c..e794b7365 100644
--- a/utils/irqbalance/files/irqbalance.init
+++ b/utils/irqbalance/files/irqbalance.init
@@ -4,9 +4,14 @@ START=11
USE_PROCD=1
start_service() {
- procd_open_instance "irqbalance"
- procd_set_param command /usr/sbin/irqbalance -f
- procd_set_param respawn
- procd_close_instance
+ local enabled
+ config_load 'irqbalance'
+ config_get_bool enabled irqbalance enabled 0
+ [ "$enabled" -gt 0 ] || return 0
+
+ procd_open_instance "irqbalance"
+ procd_set_param command /usr/sbin/irqbalance -f
+ procd_set_param respawn
+ procd_close_instance
}