[arch-projects] [initscripts] [PATCH 06/18] fsck_all, kill_everything: Clean up pre/post hook pairs run_hook positions

Kurt J. Bosch kjb-temp-2009 at alpenjodel.de
Mon Jun 27 13:11:12 EDT 2011


Make all pairs of run_hook *_{pre,post}* surround the object they refer to in their name which are one of:
* A series of One or more status blocks performing one specific action. (like killall)
* A single command like fsck/mount.

Long story:
Currently most run_hook calls are located out of any status blocks, but in some cases we need them to be inside.
Example: Having the sysinit_prefsck hook _after_ the stat_busy allows us to save the message string before redirecting the fsck progress status into a splash status line and then restore the original message whenever fsck stops to output progress status (which is currently supported for ext[234] only AFAIK). This is actually done in fbsplash-extras (AUR).
---
 functions |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/functions b/functions
index dcf6887..cdb048a 100644
--- a/functions
+++ b/functions
@@ -283,8 +283,9 @@ kill_everything() {
 	done
 
 	# Terminate all processes
-	stat_busy "Sending SIGTERM To Processes"
 	run_hook "$1_prekillall"
+	
+	stat_busy "Sending SIGTERM To Processes"
 		local pid k5args=""
 		for pid in ${omit_pids[@]}; do
 			k5args+=" -o $pid"
@@ -379,12 +380,12 @@ fsck_all() {
 		run_hook sysinit_prefsck
 		fsck -A -T -C$FSCK_FD -a -t "$NETFS,noopts=_netdev" $FORCEFSCK >$FSCK_OUT 2>$FSCK_ERR
 		local fsckret=$?
+		run_hook sysinit_postfsck
 	if (( fsckret > 1 )); then
 		stat_fail
 	else
 		stat_done
 	fi
-	run_hook sysinit_postfsck
 	return $fsckret
 }
 
-- 
1.7.1



More information about the arch-projects mailing list