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

Status command not working #4

Open
pikeas opened this issue Jan 23, 2017 · 1 comment
Open

Status command not working #4

pikeas opened this issue Jan 23, 2017 · 1 comment

Comments

@pikeas
Copy link

pikeas commented Jan 23, 2017

dest_result = shell_out("lsof -an -p #{proxy_pid} -i4@#{bastion_ip_addr}:ssh")
unless dest_result.status.success?
ui.fatal "There is a process with PID #{proxy_pid} listening on port #{local_port}, but it does not look like a tunnel"
abort
end
:

    dest_result = shell_out("lsof -an -p #{proxy_pid} -i4@#{bastion_ip_addr}:ssh")
    unless dest_result.status.success?
      ui.fatal "There is a process with PID #{proxy_pid} listening on port #{local_port}, but it does not look like a tunnel"
      abort
    end

lsof under OS X 10.12.2 doesn't seem to report the remote endpoint the way this code block expects.

$ lsof -ni | grep ssh
ssh       38571        apikeas    3u  IPv4 0x3228b7326f381f0d      0t0    TCP 127.0.0.1:pharos (LISTEN)
@rmoriz
Copy link

rmoriz commented Jul 27, 2017

I have the same issue however it is caused by not supporting IPv6. OS X prefers IPv6 when available so the tunnel is created to the resolved IPv6 bastion_ip_addr which then does not match the IPv4-only lsof call.

Workaround is to put the IPv4 address of the bastion host into knife[:bastion_host] in your knife.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants