From 2ffabaa92e029b48b24691173db9f9f4027a5728 Mon Sep 17 00:00:00 2001 From: "Eric A. Borisch" Date: Wed, 5 Jun 2019 15:35:20 -0500 Subject: [PATCH] vm-rctl: match bhyve command before name update It takes about two seconds (on my 12.0-p5 system, at least) between bhyve launch (when the process is born) and when it updates its command name to from 'bhyve -c NCPU -m MEM ... ${_name}' to 'bhyve: ${_name}'. Change the pgrep pattern in vm-rctl to catch either state rather than fail and exit out. --- lib/vm-rctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vm-rctl b/lib/vm-rctl index fbbc8db..e0245d6 100644 --- a/lib/vm-rctl +++ b/lib/vm-rctl @@ -42,7 +42,7 @@ rctl::set(){ # wait till bhyve starts and get pid sleep 1 - _pid=$(pgrep -fx "bhyve: ${_name}") + _pid=$(pgrep -fx "bhyve[: ].* ${_name}") [ -z "${_pid}" ] && return 1 # check for a priority