Add a savecore_enable variable support for the savecore rc script

By default set to 'YES' so it does not change the current behaviour for users,
this variable allows to decide to not extract crach dumps from the dump
device at boot time by setting it to "NO" in rc.conf.

Sponsored by:	Gandi.net
This commit is contained in:
Baptiste Daroussin 2016-04-29 12:23:56 +00:00
parent d308a222e9
commit 7f5ddefe05
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298784
3 changed files with 9 additions and 1 deletions

View file

@ -603,6 +603,7 @@ chkprintcap_enable="NO" # Run chkprintcap(8) before running lpd.
chkprintcap_flags="-d" # Create missing directories by default.
dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO).
dumpdir="/var/crash" # Directory where crash dumps are to be stored
savecore_enable="YES" # Extract core from dump devices if any
savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
# By default, only the 10 most recent kernel dumps
# are saved.

View file

@ -10,6 +10,7 @@
. /etc/rc.subr
name="savecore"
rcvar="savecore_enable"
desc="Save a core dump of the operating system"
start_cmd="savecore_start"
start_precmd="savecore_prestart"

View file

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 28, 2016
.Dd April 29, 2016
.Dt RC.CONF 5
.Os
.Sh NAME
@ -3511,6 +3511,12 @@ to not run
at boot time when
.Va dumpdir
is set.
.It Va savecore_enable
.Pq Vt bool
If set to
.Dq Li NO ,
disable automatic extraction of the crash dump from the
.Va dumpdev .
.It Va savecore_flags
.Pq Vt str
If crash dumps are enabled, these are the flags to pass to the