dumpon (126744) | dumpon (135525) |
---|---|
1#!/bin/sh 2# | 1#!/bin/sh 2# |
3# $FreeBSD: head/etc/rc.d/dumpon 126744 2004-03-08 12:25:05Z pjd $ | 3# $FreeBSD: head/etc/rc.d/dumpon 135525 2004-09-20 17:48:45Z des $ |
4# 5 6# PROVIDE: dumpon 7# REQUIRE: initrandom 8# BEFORE: disks savecore 9# KEYWORD: FreeBSD nojail 10 11. /etc/rc.subr --- 5 unchanged lines hidden (view full) --- 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 ;; | 4# 5 6# PROVIDE: dumpon 7# REQUIRE: initrandom 8# BEFORE: disks savecore 9# KEYWORD: FreeBSD nojail 10 11. /etc/rc.subr --- 5 unchanged lines hidden (view full) --- 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 memsize=$((`/sbin/sysctl -n hw.physmem` / 1024)) 27 while read dev mp type more ; do 28 [ "${type}" = "swap" ] || continue 29 [ -c "${dev}" ] || continue 30 /sbin/dumpon -v "${dev}" 2>/dev/null && return 0 31 done </etc/fstab 32 echo "No suitable dump device was found." 1>&2 33 return 1 34 ;; |
|
25 *) 26 /sbin/dumpon -v ${dumpdev} 27 ;; 28 esac 29} 30 31dumpon_stop() 32{ 33 case ${dumpdev} in 34 [Nn][Oo] | '') 35 ;; 36 *) 37 /sbin/dumpon -v off 38 ;; 39 esac 40} 41 42load_rc_config $name 43run_rc_command "$1" | 35 *) 36 /sbin/dumpon -v ${dumpdev} 37 ;; 38 esac 39} 40 41dumpon_stop() 42{ 43 case ${dumpdev} in 44 [Nn][Oo] | '') 45 ;; 46 *) 47 /sbin/dumpon -v off 48 ;; 49 esac 50} 51 52load_rc_config $name 53run_rc_command "$1" |