aboutsummaryrefslogtreecommitdiff
path: root/rc.single
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-02 17:28:10 +0200
committerKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-10 18:08:32 +0200
commit02de29190c10dab4d1b43062d71eff11b9c980b5 (patch)
tree2b7dea3254fd0ba3fbf841d449e5af853116dd87 /rc.single
parentd36c8a882bfdb863693d749db980af18d49e4e86 (diff)
downloadinitscripts-02de29190c10dab4d1b43062d71eff11b9c980b5.tar.xz
Refactor kill_everything, fsck_all and mount_all code
Genaral scheme for hook positions is now: run_hook pre_foo if [[$WE_WANT_TO_DO_FOO]]]; then stat_busy "Doing foo" if [[$PRECONDITIONS_FOR_FOO_NOT_SATISFIED]]; then stat_fail else ... stat_done fi fi run hook post_foo rc.sysinit ----------- run_hook pre_foo [[$WE_WANT_TO_DO_FOO]] && status "Doing foo" foo run hook post_foo functions ------------ foo() { [[$PRECONDITIONS_FOR_FOO_NOT_SATISFIED]] && return 1 ... } Rationale Following this scheme as close as possible (without duplicating code and status messages) makes stuff more readable and uniform. Splitting kill_everything() into two new functions stop_all_daemons() and kill_all() also allows customization of either daemons stopping or process killing in an easy way. Suggested-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.single')
-rwxr-xr-xrc.single9
1 files changed, 8 insertions, 1 deletions
diff --git a/rc.single b/rc.single
index d1efd41..21fe3be 100755
--- a/rc.single
+++ b/rc.single
@@ -11,7 +11,14 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
run_hook single_start
if [[ $PREVLEVEL != N ]]; then
- kill_everything single
+
+ stop_all_daemons
+
+ run_hook single_prekillall
+
+ kill_all
+
+ run_hook single_postkillall
# start up our mini logger until syslog takes over
minilogd