3 # $NetBSD: savecore,v 1.5 2002/03/22 04:34:00 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/savecore,v 1.3 2002/09/06 16:18:05 gordon Exp $
5 # $DragonFly: src/etc/rc.d/savecore,v 1.4 2003/12/14 19:13:15 dillon Exp $
11 # KEYWORD: DragonFly FreeBSD NetBSD
16 start_cmd="savecore_start"
17 start_precmd="savecore_prestart"
28 # ${DUMPDIR} should be a directory or a symbolic link
29 # to the crash directory if core dumps are to be saved.
31 DUMPDIR="${dumpdir:-/var/crash}"
35 # Quit if we have no dumb device
38 debug 'No dump device. Quitting.'
43 # If there is no crash directory set it now
52 if [ ! -e "${dumpdev}" -o ! -d "${dumpdir}" ]; then
53 warn "Wrong dump device or directory. Savecore not run."
59 # Quit if we have no dump device
62 debug 'No dump device. Quitting.'
68 # If there is no crash directory set it now
78 if [ ! -e "${dumpdev}" -o ! -d "${dumpdir}" ]; then
79 warn "Wrong dump device or directory. Savecore not run."
85 if [ ! -d "${dumpdir}" ]; then
86 warn "No /var/crash directory; savecore not run."
97 if [ X$dumpdev != X ]; then
98 echo "Checking for core dump..."
99 savecore ${savecore_flags} ${DUMPDIR}
100 return ${RC_CONFIGURED}