mirror of
https://github.com/churchers/vm-bhyve.git
synced 2025-12-11 17:30:23 +01:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user