rcrun: savecore and swap1 patch
Peter Kadau
peter.kadau at tuebingen.mpg.de
Sat Dec 13 10:19:34 PST 2003
Hi !
Would you please consider this ?
Any commects on style and functionality are welcome.
I'm rather unpleased by unconditionally returning
RC_CONFIGURED in savecore, but I couldn't come up with an
idea how to *check* it like I could with swap1.
Cheers
Peter
--
<peter.kadau at xxxxxxxxxxxxxxxx>
Campus der Max-Planck-Institute Tübingen
Netzwerk- und Systemadministration
Tel: +49 7071 601 598
Fax: +49 7071 601 616
diff -u -r rc.d.orig/savecore rc.d/savecore
--- rc.d.orig/savecore Sat Dec 13 15:05:55 2003
+++ rc.d/savecore Sat Dec 13 18:28:21 2003
@@ -97,6 +97,7 @@
if [ X$dumpdev != X ]; then
echo "Checking for core dump..."
savecore ${savecore_flags} ${DUMPDIR}
+ return ${RC_CONFIGURED}
fi
}
diff -u -r rc.d.orig/swap1 rc.d/swap1
--- rc.d.orig/swap1 Sat Dec 13 12:39:36 2003
+++ rc.d/swap1 Sat Dec 13 19:00:04 2003
@@ -15,7 +15,7 @@
case ${OSTYPE} in
DragonFly)
- start_cmd='swapon -a'
+ start_cmd="df_swap1_start"
stop_cmd=':'
;;
FreeBSD)
@@ -49,6 +49,16 @@
echo "Removing block-type swap devices"
swapctl -U -t blk
fi
+}
+
+df_swap1_start()
+{
+ if [ "${SYSCTL} vm.swap_enabled" = "0" ]; then
+ swapon -a && return ${RC_CONFIGURED}
+ else
+ return ${RC_CONFIGURED}
+ fi
+ return ${RC_FAILED}
}
load_rc_config swap
More information about the Submit
mailing list