Scripts to check and restart kresd if it does not respond
This commit is contained in:
parent
029201da1e
commit
7dcb836a25
3 changed files with 112 additions and 0 deletions
41
sysadmin/dnscheck.init
Normal file
41
sysadmin/dnscheck.init
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# start dnscheck
|
||||
#
|
||||
# https://openwrt.org/docs/guide-developer/procd-init-script-example
|
||||
|
||||
# Init sequence
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
# PROCD
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance dnscheck
|
||||
procd_set_param command /bin/sh "/usr/lib/dnscheck/dnscheck.sh"
|
||||
|
||||
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
||||
|
||||
procd_set_param stdout 1 # forward stdout of the command to logd
|
||||
procd_set_param stderr 1 # same for stderr
|
||||
|
||||
procd_set_param pidfile /var/run/dnscheck.pid
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
logger -t "dnscheck" "kresd monitoring stopped"
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "dnscheck"
|
||||
}
|
||||
|
||||
reload_service()
|
||||
{
|
||||
stop
|
||||
start
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue