From: Richard W.M. Jones Date: Thu, 13 Oct 2011 10:56:52 +0000 (+0100) Subject: fish: docs: note how to clean up the remote process properly. X-Git-Tag: 1.12.8~10 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6ed5ad8d530dada609676a397c09700308877b81;p=libguestfs.git fish: docs: note how to clean up the remote process properly. Killing it is always a bad idea, because the qemu subprocess will be left hanging around. The best thing is to send the exit command. Cherry picked from commit 11be7d8eee16e6249ed2868b5bd552f29508ec02 and modified. --- diff --git a/fish/guestfish.pod b/fish/guestfish.pod index c09dffc..21b264a 100644 --- a/fish/guestfish.pod +++ b/fish/guestfish.pod @@ -996,14 +996,15 @@ and cleans up guestfish when the script exits: exit 1 fi - kill_guestfish () + cleanup_guestfish () { - kill $GUESTFISH_PID >/dev/null 2>&1 ||: + guestfish --remote -- exit >/dev/null 2>&1 ||: } - trap kill_guestfish EXIT + trap cleanup_guestfish EXIT ERR - guestfish --remote run - # etc. + guestfish --remote -- run + + # ... =head2 REMOTE CONTROL RUN COMMAND HANGING