[arch-projects] [PATCH] [initscripts] Add hook shutdown_pivotroot

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Sun Sep 25 20:02:49 EDT 2011


This can be useful for run apcupsd --killpower

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
---
 functions   |    1 +
 rc.shutdown |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/functions b/functions
index ab6d9ae..34fd31b 100644
--- a/functions
+++ b/functions
@@ -501,6 +501,7 @@ bootlogd_stop() {
 # shutdown_postkillall: after all processes have been killed in rc.shutdown
 # single_postkillall: after all processes have been killed in rc.single
 # shutdown_postumount: after filesystems are unmounted
+# shutdown_pivotroot: before pivot_root in rc.shutdown
 # shutdown_poweroff: directly before powering off in rc.shutdown
 #
 # Declare add_hook and run_hook as read-only to prevent overwriting them.
diff --git a/rc.shutdown b/rc.shutdown
index ea86f8f..1b35148 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -98,6 +98,8 @@ if [[ -x /run/initramfs/shutdown ]]; then
 	mount --bind /dev /run/initramfs/dev
 	mount --bind /run /run/initramfs/run
 
+	run_hook shutdown_pivotroot
+
 	# enter shutdownramfs
 	cd /run/initramfs
 	pivot_root . oldroot
-- 
1.7.6.4



More information about the arch-projects mailing list