mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
Creashlog: handle default values.
This commit is contained in:
parent
adaacf2a8f
commit
be38a7233b
3 changed files with 49 additions and 5 deletions
|
|
@ -23,6 +23,15 @@ send_log()
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fill_in_default()
|
||||||
|
{
|
||||||
|
/sbin/uci add system log
|
||||||
|
/sbin/uci rename system.@log[-1]=crashlog
|
||||||
|
/sbin/uci set system.crashlog.enable=no
|
||||||
|
/sbin/uci set system.crashlog.server="crash.inteno.se"
|
||||||
|
/sbin/uci commit
|
||||||
|
}
|
||||||
|
|
||||||
boot()
|
boot()
|
||||||
{
|
{
|
||||||
# is crashlog enabled ?
|
# is crashlog enabled ?
|
||||||
|
|
@ -31,6 +40,10 @@ boot()
|
||||||
0|no|NO|false|FALSE)
|
0|no|NO|false|FALSE)
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
"")
|
||||||
|
fill_in_default
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# is this boot a result from a crash ?
|
# is this boot a result from a crash ?
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,27 @@ alive()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fill_in_default()
|
||||||
|
{
|
||||||
|
/sbin/uci add system log
|
||||||
|
/sbin/uci rename system.@log[-1]=corelog
|
||||||
|
/sbin/uci set system.corelog.enable=no
|
||||||
|
/sbin/uci set system.corelog.server="crash.inteno.se"
|
||||||
|
/sbin/uci commit
|
||||||
|
}
|
||||||
|
|
||||||
# is corelog enabled ?
|
# is corelog enabled ?
|
||||||
enable=$(/sbin/uci get system.corelog.enable)
|
enable=$(/sbin/uci get system.corelog.enable)
|
||||||
case $enable in
|
case $enable in
|
||||||
0|no|NO|false|FALSE|"")
|
0|no|NO|false|FALSE)
|
||||||
# drain core file from kernel
|
# drain core file from kernel
|
||||||
cat >/dev/null
|
cat >/dev/null
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
"")
|
||||||
|
fill_in_default
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
server=$(/sbin/uci get system.corelog.server)
|
server=$(/sbin/uci get system.corelog.server)
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,30 @@ USE_PROCD=1
|
||||||
NAME=iwatchdog
|
NAME=iwatchdog
|
||||||
PROG=/sbin/iwatchdog
|
PROG=/sbin/iwatchdog
|
||||||
|
|
||||||
|
fill_in_default()
|
||||||
|
{
|
||||||
|
/sbin/uci add system log
|
||||||
|
/sbin/uci rename system.@log[-1]=watchdog
|
||||||
|
/sbin/uci set system.watchdog.enable=no
|
||||||
|
/sbin/uci commit
|
||||||
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
procd_open_instance
|
enable=$(/sbin/uci get system.watchdog.enable)
|
||||||
procd_set_param command "$PROG"
|
case $enable in
|
||||||
procd_set_param respawn
|
0|no|NO|false|FALSE)
|
||||||
procd_close_instance
|
exit 0
|
||||||
|
;;
|
||||||
|
"")
|
||||||
|
fill_in_default
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG"
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
#stop() {
|
#stop() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue