packages/utils/irqbalance/files/irqbalance.init
Marc Benoit b6078559cd irqbalance: support reload_config & start later
Added support for reload_config

This service does not need to start so early (even
before the netwrok is up). Start it after
the device is mostly up and operational.

Compile-tested on: ipq806x
Runtime-tested on: ipq806x

Signed-off-by: Marc Benoit <marcb62185@gmail.com>
2020-03-03 07:58:27 -05:00

34 lines
637 B
Bash

#!/bin/sh /etc/rc.common
START=90
STOP=10
USE_PROCD=1
service_triggers()
{
procd_add_reload_trigger "irqbalance"
}
start_service() {
local enabled
config_load 'irqbalance'
config_get_bool enabled irqbalance enabled 0
[ "$enabled" -gt 0 ] || return 0
# 10 is the default
config_get interval irqbalance interval 10
# A list of IRQ's to ignore
banirq=""
handle_banirq_value()
{
banirq="$banirq -i $1"
}
config_list_foreach irqbalance banirq handle_banirq_value
procd_open_instance "irqbalance"
procd_set_param command /usr/sbin/irqbalance -f -t "$interval" "$banirq"
procd_set_param respawn
procd_close_instance
}