1 #!/bin/sh 2 # 3 # $NetBSD: savecore,v 1.5 2002/03/22 04:34:00 thorpej Exp $ 4 # 5 6 # PROVIDE: savecore 7 # REQUIRE: syslogd 8 # BEFORE: SERVERS 9 10 . /etc/rc.subr 11 12 name="savecore" 13 rcvar=$name 14 start_cmd="savecore_start" 15 stop_cmd=":" 16 17 savecore_start() 18 { 19 # /var/crash should be a directory or a symbolic link 20 # to the crash directory if core dumps are to be saved. 21 # 22 if [ -d /var/crash/. ]; then 23 echo "Checking for core dump..." 24 savecore $rc_flags /var/crash 25 else 26 warn "No /var/crash directory; savecore not run." 27 fi 28 } 29 30 load_rc_config $name 31 run_rc_command "$1" 32