2008-03-05 18:32:58 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: ddb
|
|
|
|
# REQUIRE: dumpon
|
2010-05-19 19:03:19 +00:00
|
|
|
# BEFORE: disks
|
2008-03-05 18:32:58 +00:00
|
|
|
# KEYWORD: nojail
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="ddb"
|
2016-04-23 16:10:54 +00:00
|
|
|
desc="DDB kernel debugger"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="ddb_enable"
|
2008-03-05 18:32:58 +00:00
|
|
|
command="/sbin/${name}"
|
|
|
|
start_precmd="ddb_prestart"
|
2018-04-19 15:02:53 +00:00
|
|
|
start_cmd="ddb_start"
|
2008-03-05 18:32:58 +00:00
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
ddb_prestart()
|
|
|
|
{
|
|
|
|
# Silently exit if ddb is not enabled
|
|
|
|
if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-04-19 15:02:53 +00:00
|
|
|
ddb_start()
|
|
|
|
{
|
|
|
|
${command} ${command_args}
|
|
|
|
}
|
|
|
|
|
2008-03-05 18:32:58 +00:00
|
|
|
load_rc_config $name
|
|
|
|
|
|
|
|
required_files="${ddb_config}"
|
|
|
|
command_args="${ddb_config}"
|
|
|
|
|
|
|
|
run_rc_command "$1"
|