summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/ddb
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2008-03-05 18:32:58 +0000
committerbrooks <brooks@FreeBSD.org>2008-03-05 18:32:58 +0000
commitf11bd3ace802f1a1a51a61be1767c1985527cf60 (patch)
treee832b8461ba906f164938e2ac47ee22f8f876cfa /etc/rc.d/ddb
parent90e24ae3e22f9346df7fa91dfc9d1e510ce50e1b (diff)
downloadFreeBSD-src-f11bd3ace802f1a1a51a61be1767c1985527cf60.zip
FreeBSD-src-f11bd3ace802f1a1a51a61be1767c1985527cf60.tar.gz
Use the new command file feature of ddb(8) to support setting ddb(4)
scripts at boot. This is currently disabled by default. /etc/ddb.conf contains some potentially reasonable default scripts. PR: conf/119995 Submitted by: Scot Hetzel <swhetzel at gmail dot com> (Earlier version) X-MFC after: textdumps
Diffstat (limited to 'etc/rc.d/ddb')
-rw-r--r--etc/rc.d/ddb32
1 files changed, 32 insertions, 0 deletions
diff --git a/etc/rc.d/ddb b/etc/rc.d/ddb
new file mode 100644
index 0000000..f4d34b1
--- /dev/null
+++ b/etc/rc.d/ddb
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ddb
+# REQUIRE: dumpon
+# BEFORE: disks savecore initrandom
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="ddb"
+rcvar=`set_rcvar`
+command="/sbin/${name}"
+start_precmd="ddb_prestart"
+stop_cmd=":"
+
+ddb_prestart()
+{
+ # Silently exit if ddb is not enabled
+ if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
+ return 1
+ fi
+}
+
+load_rc_config $name
+
+required_files="${ddb_config}"
+command_args="${ddb_config}"
+
+run_rc_command "$1"
OpenPOWER on IntegriCloud