[arch-releng] [RFC] [PATCH] [archiso] Avoid killing nbd-daemon on shutdown.
Gerardo Exequiel Pozzi
vmlinuz386 at yahoo.com.ar
Sun May 29 21:19:03 EDT 2011
Needs initscripts > 2011.05.2 (not released yet)
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
---
archiso/hooks/archiso_pxe_nbd | 2 ++
.../etc/rc.d/functions.d/omit_kill_nbd_client | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 configs/syslinux-iso/overlay/etc/rc.d/functions.d/omit_kill_nbd_client
diff --git a/archiso/hooks/archiso_pxe_nbd b/archiso/hooks/archiso_pxe_nbd
index f18fd4c..484a27c 100644
--- a/archiso/hooks/archiso_pxe_nbd
+++ b/archiso/hooks/archiso_pxe_nbd
@@ -86,5 +86,7 @@ archiso_pxe_nbd_mount_handler () {
if [ "${copytoram}" = "y" ]; then
msg "::: Disconnect NBD from ${nbdserver} at /dev/nbd0"
nbd-client -d /dev/nbd0
+ else
+ pidof nbd-client > /run/nbd_client.pid
fi
}
diff --git a/configs/syslinux-iso/overlay/etc/rc.d/functions.d/omit_kill_nbd_client b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/omit_kill_nbd_client
new file mode 100644
index 0000000..ce630a5
--- /dev/null
+++ b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/omit_kill_nbd_client
@@ -0,0 +1,6 @@
+omit_kill_nbd_client() {
+ add_omit_pids $(< /run/nbd_client.pid)
+}
+
+add_hook shutdown_prekillall omit_kill_nbd_client
+add_hook single_prekillall omit_kill_nbd_client
--
1.7.5.2
More information about the arch-releng
mailing list