NetBSD/etc/rc.d/savecore

34 lines
612 B
Plaintext
Raw Normal View History

2000-03-10 14:53:23 +03:00
#!/bin/sh
#
# $NetBSD: savecore,v 1.8 2009/09/14 17:34:56 apb Exp $
2000-03-10 14:53:23 +03:00
#
# PROVIDE: savecore
# REQUIRE: syslogd
# BEFORE: SERVERS
2000-03-10 14:53:23 +03:00
$_rc_subr_loaded . /etc/rc.subr
2000-03-10 14:53:23 +03:00
name="savecore"
rcvar=$name
2000-03-10 14:53:23 +03:00
start_cmd="savecore_start"
stop_cmd=":"
savecore_start()
{
# /var/crash should be a directory or a symbolic link
# to the crash directory if core dumps are to be saved.
#
if [ -d "${savecore_dir}/." ]; then
2000-03-10 14:53:23 +03:00
echo "Checking for core dump..."
if savecore -n; then
savecore $rc_flags "${savecore_dir}"
fi
2000-03-10 14:53:23 +03:00
else
warn "No crash dump directory; savecore not run."
2000-03-10 14:53:23 +03:00
fi
}
load_rc_config $name
2000-03-10 14:53:23 +03:00
run_rc_command "$1"