46 lines
995 B
Bash
Executable File
46 lines
995 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
USE_PROCD=1
|
|
START=50
|
|
|
|
DAEMON=/usr/bin/respondd
|
|
PIDFILE=/var/run/respondd.pid
|
|
|
|
validate_respondd_section() {
|
|
uci_validate_section respondd respondd "${1}" \
|
|
'port:uinteger' \
|
|
'mcast_group:string' \
|
|
'iface_list_file:file' \
|
|
'data_dir:directory'
|
|
}
|
|
|
|
start_service() {
|
|
config_load respondd
|
|
config_foreach start_respondd respondd
|
|
}
|
|
|
|
start_respondd() {
|
|
local port mcast_group iface_list_file data_dir
|
|
validate_respondd_section "$1"
|
|
|
|
procd_open_instance
|
|
procd_set_param command $DAEMON \
|
|
${mcast_group:+-g "$mcast_group"} \
|
|
${iface_list_file:+-c "$iface_list_file"} \
|
|
${port:+-p $port} \
|
|
${data_dir:+-d "$data_dir"}
|
|
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
|
procd_set_param pidfile $PIDFILE
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|
|
|
|
reload_service() {
|
|
kill -HUP $(cat $PIDFILE)
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "respondd"
|
|
procd_add_validation "validate_respondd_section"
|
|
}
|