dumpdev: respect kenv for stable branches
We have somewhat twisted logic to determine actions for dumpdev considering three sources of information: * kenv "dumpdev" tunnable supposed to point to specific device; * /etc/defaults/rc.conf "dumpdev" variable; * /etc/rc.conf that may be unset or set to "NO", "AUTO" or device name. For CURRENT without any setting in kenv or /etc/rc.conf the default is "AUTO". For STABLE branches the default is "NO". Current implementation breaks for STABLE branches if kenv points to specific device but /etc/rc.conf does not set "dumpdev" at all. Let us fix it commenting out "dumpdev" in /etc/defaults/rc.conf for STABLE branches and making the code to consult kenv if "dumpdev" is not set elsewhere. MFC-after: 1 month
This commit is contained in:
parent
005aa1743b
commit
ccc806a049
@ -643,7 +643,9 @@ lpd_flags="" # Flags to lpd (if enabled).
|
|||||||
nscd_enable="NO" # Run the nsswitch caching daemon.
|
nscd_enable="NO" # Run the nsswitch caching daemon.
|
||||||
chkprintcap_enable="NO" # Run chkprintcap(8) before running lpd.
|
chkprintcap_enable="NO" # Run chkprintcap(8) before running lpd.
|
||||||
chkprintcap_flags="-d" # Create missing directories by default.
|
chkprintcap_flags="-d" # Create missing directories by default.
|
||||||
dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO).
|
dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO);
|
||||||
|
# this should be commented out here
|
||||||
|
# for stable branches to respect kenv.
|
||||||
dumpon_flags="" # Options to pass to dumpon(8), followed by dumpdev.
|
dumpon_flags="" # Options to pass to dumpon(8), followed by dumpdev.
|
||||||
dumpdir="/var/crash" # Directory where crash dumps are to be stored
|
dumpdir="/var/crash" # Directory where crash dumps are to be stored
|
||||||
savecore_enable="YES" # Extract core from dump devices if any
|
savecore_enable="YES" # Extract core from dump devices if any
|
||||||
|
@ -52,15 +52,18 @@ dumpon_start()
|
|||||||
# early so a crash early in the boot process can be caught.
|
# early so a crash early in the boot process can be caught.
|
||||||
#
|
#
|
||||||
case ${dumpdev} in
|
case ${dumpdev} in
|
||||||
[Nn][Oo] | '')
|
[Nn][Oo])
|
||||||
;;
|
;;
|
||||||
[Aa][Uu][Tt][Oo])
|
[Aa][Uu][Tt][Oo] | '')
|
||||||
root_hold_wait
|
root_hold_wait
|
||||||
dev=$(/bin/kenv -q dumpdev)
|
dev=$(/bin/kenv -q dumpdev)
|
||||||
if [ -n "${dev}" ] ; then
|
if [ -n "${dev}" ] ; then
|
||||||
dumpon_try "${dev}"
|
dumpon_try "${dev}"
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
|
if [ -z ${dumpdev} ] ; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
while read dev mp type more ; do
|
while read dev mp type more ; do
|
||||||
[ "${type}" = "swap" ] || continue
|
[ "${type}" = "swap" ] || continue
|
||||||
case ${dev} in
|
case ${dev} in
|
||||||
@ -85,7 +88,7 @@ dumpon_start()
|
|||||||
dumpon_stop()
|
dumpon_stop()
|
||||||
{
|
{
|
||||||
case ${dumpdev} in
|
case ${dumpdev} in
|
||||||
[Nn][Oo] | '')
|
[Nn][Oo])
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
rm -f /dev/dumpdev
|
rm -f /dev/dumpdev
|
||||||
|
@ -20,11 +20,11 @@ savecore_prestart()
|
|||||||
{
|
{
|
||||||
# Quit if we have no dump device
|
# Quit if we have no dump device
|
||||||
case ${dumpdev} in
|
case ${dumpdev} in
|
||||||
[Nn][Oo] | '')
|
[Nn][Oo])
|
||||||
debug 'No dump device. Quitting.'
|
debug 'No dump device. Quitting.'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
[Aa][Uu][Tt][Oo])
|
[Aa][Uu][Tt][Oo] | '')
|
||||||
if [ ! -L /dev/dumpdev ]; then
|
if [ ! -L /dev/dumpdev ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user