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 38# doesn't make sense to run in a svcj: privileged operation 39ddb_svcj="NO" 40 41run_rc_command "$1" 42