From 83056f4baf4e9e90e3a77ed3eca3f7eca1c13524 Mon Sep 17 00:00:00 2001 From: Derek Marcotte <554b8425@razorfever.net> Date: Wed, 3 Oct 2018 14:28:34 -0400 Subject: [PATCH] Fix: This guest appears to be already running/loaded. There is a race condition where iohyve will fail to start a bhyve instance when there is a running iohyve with the prefix of the same name as the iohyve you are trying to start. e.g. (you have `example-other` running): `iohyve start example` Will fail with the error message: ``` This guest appears to be already running/loaded. Use stop, destroy, or forcekill to remove zombie processes. ``` This corrects the pgrep regexs to stop matching past the name. --- lib/ioh-guest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ioh-guest b/lib/ioh-guest index 50bbb32..8335bb5 100644 --- a/lib/ioh-guest +++ b/lib/ioh-guest @@ -319,7 +319,7 @@ __guest_load() { *) local wire_memory="" ;; esac # Check for loader already present as a zombie - if [ ! -z $(pgrep -f "ioh-$name") ]; then + if [ ! -z $(pgrep -xf "bhyve: ioh-$name") ]; then echo "This guest appears to be already running/loaded." echo "Use stop, destroy, or forcekill to remove zombie processes." exit 1