From bdd302adaa2b9e1276abc6505e081e0e19a2a84a Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Sat, 18 Jun 2011 19:46:08 -0300 Subject: Avoid killing nbd-daemon on shutdown Signed-off-by: Gerardo Exequiel Pozzi --- archiso/hooks/archiso_pxe_nbd | 2 ++ .../releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 configs/releng/root-image/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/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client b/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client new file mode 100644 index 0000000..b72f168 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client @@ -0,0 +1,8 @@ +if [[ -f /run/nbd_client.pid ]]; then + 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 +fi -- cgit v1.2.2