Skip to content

Commit 4dfc78e

Browse files
ricardobranco777mhorne
authored andcommitted
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: #2199
1 parent 453de99 commit 4dfc78e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

usr.sbin/crashinfo/crashinfo.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,13 @@ fi
149149
VMCORE=$CRASHDIR/vmcore.$DUMPNR
150150
INFO=$CRASHDIR/info.$DUMPNR
151151
FILE=$CRASHDIR/core.txt.$DUMPNR
152+
LINK=$CRASHDIR/core.txt.last
152153
HOSTNAME=`hostname`
153154

154155
if $BATCH; then
155156
echo "Writing crash summary to $FILE."
156157
exec > $FILE 2>&1
158+
ln -sf $FILE $LINK
157159
fi
158160

159161
GDB=/usr/local/bin/gdb
@@ -204,6 +206,7 @@ machine=$(gdb_command $KERNEL 'printf "%s", machine')
204206
if ! $BATCH; then
205207
echo "Writing crash summary to $FILE."
206208
exec > $FILE 2>&1
209+
ln -sf $FILE $LINK
207210
fi
208211

209212
echo "$HOSTNAME dumped core - see $VMCORE"

0 commit comments

Comments
 (0)