From 5f89bdd921f672a4772c8f992cbed2d97023f943 Mon Sep 17 00:00:00 2001 From: atatat Date: Thu, 15 Jul 2004 03:29:55 +0000 Subject: [PATCH] Make the directory into which crash dumps are saved into something that can be controlled via rc.conf. The default is, of course, /var/crash. --- etc/defaults/rc.conf | 3 ++- etc/rc.d/savecore | 8 ++++---- share/man/man5/rc.conf.5 | 6 +++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index b38cdef0caff..557216f2dd24 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -1,4 +1,4 @@ -# $NetBSD: rc.conf,v 1.60 2004/07/04 13:59:34 martin Exp $ +# $NetBSD: rc.conf,v 1.61 2004/07/15 03:29:55 atatat Exp $ # # /etc/defaults/rc.conf -- # default configuration of /etc/rc.conf @@ -99,6 +99,7 @@ lkm=NO # Run /etc/rc.lkm. /usr needs to be part of /, or # part of critical_filesystems_local. savecore=YES savecore_flags="-z" + savecore_dir="/var/crash" clear_tmp=YES # clear /tmp after reboot update_motd=YES # updates /etc/motd dmesg=YES dmesg_flags="" # write /var/run/dmesg.boot diff --git a/etc/rc.d/savecore b/etc/rc.d/savecore index 35e2a1df02fd..90d44fc8eef9 100755 --- a/etc/rc.d/savecore +++ b/etc/rc.d/savecore @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: savecore,v 1.5 2002/03/22 04:34:00 thorpej Exp $ +# $NetBSD: savecore,v 1.6 2004/07/15 03:29:55 atatat Exp $ # # PROVIDE: savecore @@ -19,11 +19,11 @@ 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 /var/crash/. ]; then + if [ -d "${savecore_dir}/." ]; then echo "Checking for core dump..." - savecore $rc_flags /var/crash + savecore $rc_flags "${savecore_dir}" else - warn "No /var/crash directory; savecore not run." + warn "No crash dump directory; savecore not run." fi } diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 57ba38ab4878..5cd07d6cf1c3 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -1,4 +1,4 @@ -.\" $NetBSD: rc.conf.5,v 1.88 2004/01/15 09:14:54 jmmv Exp $ +.\" $NetBSD: rc.conf.5,v 1.89 2004/07/15 03:29:55 atatat Exp $ .\" .\" Copyright (c) 1996 Matthew R. Green .\" Copyright (c) 1997 Curt J. Sampson @@ -316,6 +316,10 @@ Runs the utility. Passes .Sy savecore_flags . +The directory where crash dumps are stored is specified by +.Sy savecore_dir . +The default setting is +.Dq /var/crash . .It Sy tpctl .Sq YES or