dumpon revision 144683
1#!/bin/sh 2# 3# $FreeBSD: head/etc/rc.d/dumpon 144683 2005-04-05 18:59:24Z obrien $ 4# 5 6# PROVIDE: dumpon 7# REQUIRE: rcconf 8# BEFORE: disks savecore initrandom 9# KEYWORD: nojail 10 11. /etc/rc.subr 12 13name="dumpon" 14start_cmd="dumpon_start" 15stop_cmd="dumpon_stop" 16 17dumpon_start() 18{ 19 # Enable dumpdev so that savecore can see it. Enable it 20 # early so a crash early in the boot process can be caught. 21 # 22 case ${dumpdev} in 23 [Nn][Oo] | '') 24 ;; 25 [Aa][Uu][Tt][Oo]) 26 while read dev mp type more ; do 27 [ "${type}" = "swap" ] || continue 28 [ -c "${dev}" ] || continue 29 if /sbin/dumpon -v "${dev}" 2>/dev/null; then 30 # Make a symlink in devfs for savecore 31 ln -s ${dev} /dev/dumpdev 32 return 0 33 fi 34 done </etc/fstab 35 echo "No suitable dump device was found." 1>&2 36 return 1 37 ;; 38 *) 39 /sbin/dumpon -v ${dumpdev} 40 ;; 41 esac 42} 43 44dumpon_stop() 45{ 46 case ${dumpdev} in 47 [Nn][Oo] | '') 48 ;; 49 *) 50 rm -f /dev/dumpdev 51 /sbin/dumpon -v off 52 ;; 53 esac 54} 55 56load_rc_config $name 57run_rc_command "$1" 58