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
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
# is crashlog enabled ?
|
||||
|
|
@ -31,6 +40,10 @@ boot()
|
|||
0|no|NO|false|FALSE)
|
||||
exit 0
|
||||
;;
|
||||
"")
|
||||
fill_in_default
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# is this boot a result from a crash ?
|
||||
|
|
|
|||
|
|
@ -15,15 +15,27 @@ alive()
|
|||
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 ?
|
||||
enable=$(/sbin/uci get system.corelog.enable)
|
||||
case $enable in
|
||||
0|no|NO|false|FALSE|"")
|
||||
0|no|NO|false|FALSE)
|
||||
# drain core file from kernel
|
||||
cat >/dev/null
|
||||
exit 0
|
||||
;;
|
||||
"")
|
||||
fill_in_default
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
server=$(/sbin/uci get system.corelog.server)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,26 @@ USE_PROCD=1
|
|||
NAME=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() {
|
||||
enable=$(/sbin/uci get system.watchdog.enable)
|
||||
case $enable in
|
||||
0|no|NO|false|FALSE)
|
||||
exit 0
|
||||
;;
|
||||
"")
|
||||
fill_in_default
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue