diff options
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc | 8 | ||||
-rwxr-xr-x | etc/rc.dumpon | 22 | ||||
-rw-r--r-- | etc/rc.savecore | 22 |
3 files changed, 29 insertions, 23 deletions
@@ -25,6 +25,12 @@ PLATFORM=`/bin/cat /etc/platform` # Set our current version version=`/bin/cat /etc/version` +# Setup dumpdev/ddb/savecore" +echo "Configuring crash dumps..." +if [ "$PLATFORM" = "pfSense" ]; then + /etc/rc.dumpon +fi + # Mount memory file system if it exists echo "Mounting filesystems..." @@ -110,9 +116,9 @@ elif [ "$PLATFORM" = "nanobsd" ] ; then /bin/rm -rf /var/db/pkg /bin/ln -s /root/var/db/pkg/ /var/db/pkg else - /etc/rc.dumpon SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1` /sbin/swapon -a 2>/dev/null >/dev/null + /etc/rc.savecore fi if [ "$PLATFORM" = "cdrom" ] ; then diff --git a/etc/rc.dumpon b/etc/rc.dumpon index 7e72a73..fad1a82 100755 --- a/etc/rc.dumpon +++ b/etc/rc.dumpon @@ -1,7 +1,6 @@ #!/bin/sh # Based on: # FreeBSD: src/etc/rc.d/dumpon,v 1.12.2.1.4.1 2010/06/14 02:09:06 kensmith Exp -# FreeBSD: src/etc/rc.d/savecore,v 1.16.2.2.4.1 2010/06/14 02:09:06 kensmith Exp # dumpon @@ -34,24 +33,3 @@ fi if [ ! -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then /sbin/ddb /etc/ddb.conf fi - -# savecore - -dumpdev=`/bin/realpath /dev/dumpdev` -dumpdir='/var/crash' - -if [ ! -c "${dumpdev}" ]; then - echo "Dump device does not exist. Savecore not run." - exit -fi - -if [ ! -d "${dumpdir}" ]; then - echo "Dump directory does not exist. Savecore not run." - exit -fi - -if savecore -C "${dumpdir}" "${dumpdev}" >/dev/null; then - savecore ${dumpdir} ${dumpdev} -else - echo 'No core dumps found.' -fi diff --git a/etc/rc.savecore b/etc/rc.savecore new file mode 100644 index 0000000..8685330 --- /dev/null +++ b/etc/rc.savecore @@ -0,0 +1,22 @@ +#!/bin/sh +# Based on: +# FreeBSD: src/etc/rc.d/savecore,v 1.16.2.2.4.1 2010/06/14 02:09:06 kensmith Exp + +dumpdev=`/bin/realpath /dev/dumpdev` +dumpdir='/var/crash' + +if [ ! -c "${dumpdev}" ]; then + echo "Dump device does not exist. Savecore not run." + exit +fi + +if [ ! -d "${dumpdir}" ]; then + echo "Dump directory does not exist. Savecore not run." + exit +fi + +if savecore -C "${dumpdir}" "${dumpdev}" >/dev/null; then + savecore ${dumpdir} ${dumpdev} +else + echo 'No core dumps found.' +fi |