aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Branco <rbranco@suse.de>2026-05-15 14:58:41 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2026-05-28 16:20:30 +0000
commit4dfc78e0e3bb096514455e9bb6cf63e46e84db13 (patch)
treea821bcf679488f66c00fcd44cbbedfdb9db94612
parent453de99b386d40754a038cc4b804f4c7a3b04624 (diff)
crashinfo: Create core.txt.last symlink
When saving a coredump, savecore(8) maintains .last symlinks for the info and vmcore artifacts, but not for the crashinfo text report. Make crashinfo(8) create the link, pointing at the current core.txt.<bounds> file. This makes /var/crash/core.txt.last track the same core dump as info.last and vmcore.last. [mhorne: I tweaked the submission, such that the link will be created as soon as the core.txt.X file is generated; not only after a successful report has been written.] Signed-off-by: Ricardo Branco <rbranco@suse.de> Reviewed by: mhorne MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/2199
-rwxr-xr-xusr.sbin/crashinfo/crashinfo.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh
index 68115f09f9d4..87e5565b98e3 100755
--- a/usr.sbin/crashinfo/crashinfo.sh
+++ b/usr.sbin/crashinfo/crashinfo.sh
@@ -149,11 +149,13 @@ fi
VMCORE=$CRASHDIR/vmcore.$DUMPNR
INFO=$CRASHDIR/info.$DUMPNR
FILE=$CRASHDIR/core.txt.$DUMPNR
+LINK=$CRASHDIR/core.txt.last
HOSTNAME=`hostname`
if $BATCH; then
echo "Writing crash summary to $FILE."
exec > $FILE 2>&1
+ ln -sf $FILE $LINK
fi
GDB=/usr/local/bin/gdb
@@ -204,6 +206,7 @@ machine=$(gdb_command $KERNEL 'printf "%s", machine')
if ! $BATCH; then
echo "Writing crash summary to $FILE."
exec > $FILE 2>&1
+ ln -sf $FILE $LINK
fi
echo "$HOSTNAME dumped core - see $VMCORE"