From 58fc27aaeb6d7d67cdf93997a33e0cbe4b5d7ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Wed, 26 Aug 2009 23:26:54 +0200 Subject: Make the hook-system a bit more usable This patch makes the hook names unique, prefixing them all with the script name (without the 'rc.') It also removes the explicit declarations of all elements of the array, bash assumes "" if they are uninitialized --- rc.single | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rc.single') diff --git a/rc.single b/rc.single index d72e95b..2927932 100755 --- a/rc.single +++ b/rc.single @@ -6,7 +6,7 @@ . /etc/rc.conf . /etc/rc.d/functions -run_hook start rc.single +run_hook single_start if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Find daemons NOT in the DAEMONS array. Shut these down first @@ -28,7 +28,7 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then fi if [ "$PREVLEVEL" != "N" ]; then - run_hook prekillall rc.single + run_hook single_prekillall # Terminate all processes stat_busy "Sending SIGTERM To Processes" @@ -41,13 +41,13 @@ if [ "$PREVLEVEL" != "N" ]; then /bin/sleep 1 stat_done - run_hook postkillall rc.single + run_hook single_postkillall stat_busy "Starting UDev Daemon" /sbin/udevd --daemon stat_done - run_hook udevlaunched rc.single + run_hook single_udevlaunched # Trigger udev uevents if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then @@ -63,7 +63,7 @@ if [ "$PREVLEVEL" != "N" ]; then stat_done fi - run_hook udevsettled rc.single + run_hook single_udevsettled # try syslog-NG first, then fall back to good ol' syslogd if [ -x /etc/rc.d/syslog-ng ]; then @@ -74,7 +74,7 @@ if [ "$PREVLEVEL" != "N" ]; then fi fi -run_hook end rc.single +run_hook single_end if [ "$RUNLEVEL" = "1" ]; then printsep -- cgit v1.2.3