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

Posix::Spawn::Child gets stuck when restarting service #69

Open
hkraji opened this issue Jul 7, 2015 · 0 comments
Open

Posix::Spawn::Child gets stuck when restarting service #69

hkraji opened this issue Jul 7, 2015 · 0 comments

Comments

@hkraji
Copy link

hkraji commented Jul 7, 2015

I've tested this on ruby1.9 and ruby2.0 and tried different versions of posix-spawn gem. These include 0.3.5, 0.3.9, 0.3.11. This snippet I had ran on Amazon Linux as root user. Here is example of code:

    require 'pp'
    require 'posix-spawn'
    # I've used mcollective here, but other services I've tried gave same result
    formulate_command = "service mcollective restart"
    pp 'start'
    process = POSIX::Spawn::Child.new(formulate_command)
    pp process
    pp 'end'

This will freeze and it will never return process object, I've debugged code and it freezes on line https://github.com/rtomayko/posix-spawn/blob/master/lib/posix/spawn/child.rb#L228.

Interesting thing is, if I run same command with sudo prefix it will work.

Also both commands will work if run with Kernel#system and Kernel#``. POSIX::Spawn#popen4` will also not work for case described above.

EDIT

After some investigation I find that this issue is probably related to this http://stackoverflow.com/questions/8952043/how-to-fix-hanging-popen3-in-ruby

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

1 participant