git: c794fe2a9462 - stable/15 - crashinfo: Create core.txt.last symlink
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Jul 2026 15:28:29 UTC
The branch stable/15 has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=c794fe2a9462e706d0aa47a819de6957e6c1d677
commit c794fe2a9462e706d0aa47a819de6957e6c1d677
Author: Ricardo Branco <rbranco@suse.de>
AuthorDate: 2026-05-15 14:58:41 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-07-10 15:28:09 +0000
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
(cherry picked from commit 4dfc78e0e3bb096514455e9bb6cf63e46e84db13)
---
usr.sbin/crashinfo/crashinfo.sh | 3 +++
1 file changed, 3 insertions(+)
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"