Skip to content

Commit

Permalink
Fix: This guest appears to be already running/loaded.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
derekmarcotte committed Jul 30, 2024
1 parent 2950404 commit 83056f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ioh-guest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 83056f4

Please sign in to comment.