dumpon revision 136684
198184Sgordon#!/bin/sh 298184Sgordon# 398184Sgordon# $FreeBSD: head/etc/rc.d/dumpon 136684 2004-10-18 23:40:13Z thomas $ 498184Sgordon# 598184Sgordon 698184Sgordon# PROVIDE: dumpon 798184Sgordon# REQUIRE: initrandom 898184Sgordon# BEFORE: disks savecore 9136224Smtm# KEYWORD: nojail 1098184Sgordon 1198184Sgordon. /etc/rc.subr 1298184Sgordon 1398184Sgordonname="dumpon" 1498184Sgordonstart_cmd="dumpon_start" 15125341Spjdstop_cmd="dumpon_stop" 1698184Sgordon 1798184Sgordondumpon_start() 1898184Sgordon{ 1998184Sgordon # Enable dumpdev so that savecore can see it. Enable it 2098184Sgordon # early so a crash early in the boot process can be caught. 2198184Sgordon # 2298184Sgordon case ${dumpdev} in 2398184Sgordon [Nn][Oo] | '') 2498184Sgordon ;; 25135525Sdes [Aa][Uu][Tt][Oo]) 26135525Sdes while read dev mp type more ; do 27135525Sdes [ "${type}" = "swap" ] || continue 28135525Sdes [ -c "${dev}" ] || continue 29136684Sthomas if /sbin/dumpon -v "${dev}" 2>/dev/null; then 30136684Sthomas # Make a symlink in devfs for savecore 31136684Sthomas ln -s ${dev} /dev/dumpdev 32136684Sthomas return 0 33136684Sthomas fi 34135525Sdes done </etc/fstab 35135525Sdes echo "No suitable dump device was found." 1>&2 36135525Sdes return 1 37135525Sdes ;; 3898184Sgordon *) 3998184Sgordon /sbin/dumpon -v ${dumpdev} 4098184Sgordon ;; 4198184Sgordon esac 4298184Sgordon} 4398184Sgordon 44125341Spjddumpon_stop() 45125341Spjd{ 46125341Spjd case ${dumpdev} in 47125341Spjd [Nn][Oo] | '') 48125341Spjd ;; 49125341Spjd *) 50136684Sthomas rm -f /dev/dumpdev 51125341Spjd /sbin/dumpon -v off 52125341Spjd ;; 53125341Spjd esac 54125341Spjd} 55125341Spjd 5698184Sgordonload_rc_config $name 5798184Sgordonrun_rc_command "$1" 58