xref: /freebsd/libexec/rc/rc.d/ddb (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1#!/bin/sh
2#
3#
4
5# PROVIDE: ddb
6# REQUIRE: dumpon
7# BEFORE: disks
8# KEYWORD: nojail
9
10. /etc/rc.subr
11
12name="ddb"
13desc="DDB kernel debugger"
14rcvar="ddb_enable"
15command="/sbin/${name}"
16start_precmd="ddb_prestart"
17start_cmd="ddb_start"
18stop_cmd=":"
19
20ddb_prestart()
21{
22	# Silently exit if ddb is not enabled
23	if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
24		return 1
25	fi
26}
27
28ddb_start()
29{
30	${command} ${command_args}
31}
32
33load_rc_config $name
34
35required_files="${ddb_config}"
36command_args="${ddb_config}"
37
38run_rc_command "$1"
39