Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore empty lockfiles #555

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/vm-core
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ core::list(){

# check if the guest is running
if vm::running_check "_run" "_pid" "${_name}" || \
[ -e "${VM_DS_PATH}/${_name}/run.lock" -a "$(head -n1 ${VM_DS_PATH}/${_name}/run.lock 2>/dev/null)" = "${_our_host}" ]; then
[ -s "${VM_DS_PATH}/${_name}/run.lock" -a "$(head -n1 ${VM_DS_PATH}/${_name}/run.lock 2>/dev/null)" = "${_our_host}" ]; then

# if running and graphics, try to get vnc port
if config::yesno "graphics"; then
Expand Down Expand Up @@ -112,7 +112,7 @@ core::list(){
done

# if stopped, see if it's locked by another host
if [ "${_run}" = "Stopped" -a -e "${VM_DS_PATH}/${_name}/run.lock" ]; then
if [ "${_run}" = "Stopped" -a -s "${VM_DS_PATH}/${_name}/run.lock" ]; then
_run=$(head -n1 "${VM_DS_PATH}/${_name}/run.lock")
_run="Locked (${_run})"
fi
Expand Down
2 changes: 1 addition & 1 deletion lib/vm-run
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ vm::confirm_stopped(){

# check vm-bhyve lock
# this will err even if guest is running on another node
if [ -e "${VM_DS_PATH}/${_name}/run.lock" ]; then
if [ -s "${VM_DS_PATH}/${_name}/run.lock" ]; then
_host=$(head -n 1 "${VM_DS_PATH}/${_name}/run.lock")

if [ "${_host}" != "${_our_host}" -o "${_skip_lock}" != "1" ]; then
Expand Down