-
Notifications
You must be signed in to change notification settings - Fork 41
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
Chef Zero Fails to Start - lsof can't find pid #11
Comments
Interesting. It is pretty fragile way to find the PID, I'll see if I can think of anything better than your suggestion. |
Copping out for now as scanning through the process list can be maddening and error prone. I will push this change out soon. |
Fixed in |
Andrew--I was looking into what it would take to get this plugin working on Windows. I'm not really familiar with Ruby so I'll spare both of us an attempt at pushing changes. When I was looking into the lsof/PID issue I found an SO question linking this blog post: http://unethicalblogger.com/2011/11/12/popen-can-suck-it.html which may give you a better way to get at the PID using proc.pid. As an aside to the issue here, downstream I ran into windows compatibility issues with file paths. |
…gphilis#11) by using chef-zero's start in background functionality. Make sure provision runs on vagrant reload as well.
After I sorted out #10 , it still wouldn't start. It looks like it came down to this line:
pid = %x[ lsof -i tcp:#{port} | grep ruby | awk '{print $2}' ]
For whatever reason, my lsof was setting the "command" to be "chef-zero" instead of ruby. Thus, I was getting this:
which the above line was never finding. So I just did this and it worked:
pid = %x[ lsof -i tcp:#{port} | grep 'chef-zero' | awk '{print $2}' ]
Maybe something like this handles both?
pid = %x[ lsof -i tcp:#{port} | grep -E 'ruby|chef-zero' | awk '{print $2}' ]
Both this and #10 are no big deal. I'm good to go for now. Just a heads up in case anyone else gets this.
The text was updated successfully, but these errors were encountered: