Skip to content

Commit

Permalink
[solaris init scripts] save the coredump into the $DUMPADM_DEVICE onl…
Browse files Browse the repository at this point in the history
…y if it exists

when this environment variable is valid (not 0 length and device exists)
  • Loading branch information
bazsi committed Mar 22, 2010
1 parent 563fd7f commit f837b6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions contrib/balabit-initscripts/init.d
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,15 @@ case $OS in
# Before syslog-ng starts, save any messages from previous
# crash dumps so that messages appear in chronological order.
#
/usr/bin/savecore -m
if [ -r /dev/dump ]; then
/usr/bin/savecore -m
fi
if [ -r /etc/dumpadm.conf ]; then
. /etc/dumpadm.conf
[ "x$DUMPADM_DEVICE" != xswap ] && \
/usr/bin/savecore -m -f $DUMPADM_DEVICE
if [ -n "$DUMPADM_DEVICE" ] && [ -r "$DUMPADM_DEVICE" ] && \
[ "x$DUMPADM_DEVICE" != xswap ]; then
/usr/bin/savecore -m -f $DUMPADM_DEVICE
fi
fi
;;
HP-UX)
Expand Down
12 changes: 8 additions & 4 deletions contrib/solaris-packaging/syslog-ng.method
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ slng_start () {
# Before syslog-ng starts, save any messages from previous
# crash dumps so that messages appear in chronological order.
#
/usr/bin/savecore -m
if [ -r /dev/dump ]; then
/usr/bin/savecore -m
fi
if [ -r /etc/dumpadm.conf ]; then
. /etc/dumpadm.conf
[ "x$DUMPADM_DEVICE" != xswap ] && \
/usr/bin/savecore -m -f $DUMPADM_DEVICE
. /etc/dumpadm.conf
if [ -n "$DUMPADM_DEVICE" ] && [ -r "$DUMPADM_DEVICE" ] && \
[ "x$DUMPADM_DEVICE" != xswap ]; then
/usr/bin/savecore -m -f $DUMPADM_DEVICE
fi
fi
check_syntax
$SYSLOGNG $OPTIONS
Expand Down

0 comments on commit f837b6e

Please sign in to comment.