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

Error in close.connection(con) : ignoring SIGPIPE signal for bash #7

Open
lyonsquark opened this issue Oct 19, 2014 · 9 comments
Open

Comments

@lyonsquark
Copy link

Hi - I'm having trouble with the persistent bash feature. For example,

> library(runr)
> b = proc_bash()
> b$start()
> b$exec("x=3")
Error in close.connection(con) : ignoring SIGPIPE signal

A subsequent attempt at b$exec(...) will hang.

I'm running OSX Mavericks. Have you seen this behavior? Thanks! -- Adam

@yihui
Copy link
Owner

yihui commented Oct 20, 2014

Yes, I tried it a while ago on OS X and failed to run bash code. I do not know why, though. It will be great if you can help me investigate this issue, since I do not use OS X very often.

@lyonsquark
Copy link
Author

Thanks for your reply, Yihui, I did some experimentation, running code similar to your bash "server" reading from a named pipe that I would echo to from another bash session. Named pipes must be very finicky in OSX. Everything I tried failed most of the time, except every now and then it would work once or twice. I was able to improve things by using the bash builtin "read" command (reads only one line) and adding short sleeps (like 0.1 seconds). I was able to make that pretty reliable, but reading one line at a time makes building up the command you want to run difficult. In fact it seems impossible since "read" discards stuff past the first line. I'll play around some more and let you know what I figure out.

@yihui
Copy link
Owner

yihui commented Oct 20, 2014

Thanks! How about using a socket server/client (e.g. http://hacktux.com/bash/socket) instead of named pipes? I have not tried utilities like nc (netcat) so I really do not know if they will work at all.

@lyonsquark
Copy link
Author

Yes - I think sockets are the way to go. Looking into that...

@lyonsquark
Copy link
Author

I think I have a working solution using sockets. Trying a few more things.

@yihui
Copy link
Owner

yihui commented Oct 20, 2014

That sounds perfect! Thanks a lot! 👍

@lyonsquark
Copy link
Author

I think I've figured things out and sockets work fine on my Mac. I submitted a pull request to you with the changes. Please try them on Linux (or whatever you use) and let me know what happens. -- Adam

@lyonsquark
Copy link
Author

Oops - didn't mean to close the issue :-)

@lyonsquark
Copy link
Author

Ahh - sorry about using "tmp" - that was less than smart of me. Thanks for fixing it. -- Adam

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