From de983ef109defa7c26081510f1a33bfae1d0b62d Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Mon, 1 May 2006 20:46:31 +0000 Subject: Add support for diskdump to swap (#182272, patch by Keiichiro Tokunaga ) --- rc.d/rc.sysinit | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 0b51f694..18791c93 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -348,9 +348,18 @@ if [ -f /etc/lvmtab ]; then fi fi +# Check if swap partition contains crash dump +swapdiskdump=0 +if [ -x /etc/init.d/diskdump ]; then + /etc/init.d/diskdump checkswapdump + swapdiskdump=$? +fi + # Start up swapping. -update_boot_stage RCswap -action $"Activating swap partitions: " swapon -a -e +if [ $swapdiskdump == 0 ]; then + update_boot_stage RCswap + action $"Activating swap partitions: " swapon -a -e +fi # Clear mtab > /etc/mtab @@ -699,6 +708,13 @@ chown root:root /tmp/.ICE-unix # Delete Postgres sockets rm -f /tmp/.s.PGSQL.* +# If swap partition has crash dump, save the dump from the swap partition to +# local filesystem and perform update_boot_stage here. +if [ $swapdiskdump == 1 ]; then + /etc/init.d/diskdump swapsavecore + update_boot_stage RCswap +fi + # Now turn on swap in case we swap to files. swapon -a action $"Enabling swap space: " /bin/true -- cgit