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