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.1 2003/07/24 06:35:37 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.'
42 # If there is no crash directory set it now
51 if [ ! -e "${dumpdev}" -o ! -d "${dumpdir}" ]; then
52 warn "Wrong dump device or directory. Savecore not run."
58 # Quit if we have no dump device
61 debug 'No dump device. Quitting.'
66 # If there is no crash directory set it now
76 if [ ! -e "${dumpdev}" -o ! -d "${dumpdir}" ]; then
77 warn "Wrong dump device or directory. Savecore not run."
82 if [ ! -d "${dumpdir}" ]; then
83 warn "No /var/crash directory; savecore not run."
93 echo "Checking for core dump..."
94 savecore ${savecore_flags} ${DUMPDIR}