aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc/rc.d/ddb
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rc/rc.d/ddb')
-rwxr-xr-xlibexec/rc/rc.d/ddb41
1 files changed, 41 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/ddb b/libexec/rc/rc.d/ddb
new file mode 100755
index 000000000000..08a7d345c326
--- /dev/null
+++ b/libexec/rc/rc.d/ddb
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+#
+
+# PROVIDE: ddb
+# REQUIRE: dumpon
+# BEFORE: disks
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="ddb"
+desc="DDB kernel debugger"
+rcvar="ddb_enable"
+command="/sbin/${name}"
+start_precmd="ddb_prestart"
+start_cmd="ddb_start"
+stop_cmd=":"
+
+ddb_prestart()
+{
+ # Silently exit if ddb is not enabled
+ if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
+ return 1
+ fi
+}
+
+ddb_start()
+{
+ ${command} ${command_args}
+}
+
+load_rc_config $name
+
+required_files="${ddb_config}"
+command_args="${ddb_config}"
+
+# doesn't make sense to run in a svcj: privileged operation
+ddb_svcj="NO"
+
+run_rc_command "$1"