freebsd-nq/etc/rc.d/ddb
Brooks Davis ae2edb2af1 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
2008-03-05 18:32:58 +00:00

33 lines
463 B
Bash

#!/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"