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

FIFO and Pipes with Bluepill #41

Open
jamestaylr opened this issue Nov 28, 2015 · 0 comments
Open

FIFO and Pipes with Bluepill #41

jamestaylr opened this issue Nov 28, 2015 · 0 comments

Comments

@jamestaylr
Copy link

I am trying to use a FIFO (named pipe) with Bluepill.

In the console, if I directly run:

tail -f /srv/input.fifo | /usr/lib/jvm/java-7-openjdk-amd64/bin/java -jar server.jar

The server starts fine and begins running. I can also redirect to the pipe, as expected:

echo 'Hello World' > /srv/input.fifo

And the server responds and behaves as intended.

I am trying to port this same functionality over to Bluepill, but I'm having some trouble. Here's the Bluepill application script:

Bluepill.application('server', log_file: '/srv/bluepill.log') do |app|
  app.process('server') do |process|
    process.pid_file = '/var/run/server.pid'
    process.working_dir = '/srv'
    process.start_command = "tail -f /srv/input.fifo | /usr/lib/jvm/java-7-openjdk-amd64/bin/java -jar server.jar"
    process.daemonize = true
  end
end

Bluepill, from the log, reflects the start_command correctly:

WARN -- : [server:server] Executing start command: tail -f /srv/input.fifo | /usr/lib/jvm/java-7-openjdk-amd64/bin/java -jar server.jar

But the server never starts running. ps aux | grep 'server' shows that it isn't running and pidof java returns nothing. Additionally, I can tell from the server's log that it never attempts to run.

If I remove tail -f /srv/input.fifo | from the start_command, the Bluepill process works as expected, although it obviously isn't using the pipe.

Out of desperation, I also tried setting an stdin attribute in the process file because this definition appeared in the repo's code (but not in the documentation), like so:

process.stdin = "/srv/input.fifo"

How can I get Bluepill to call the server using the FIFO?

I originally posted this on StackOverflow, but it hasn't gotten much attention. Given that the README shows a complex implementation with redirection and conditional operation (cd /tmp/some_dir && SOME_VAR=1 /usr/bin/some_start_command > /tmp/server.log 2>&1), this looks to me more like a bug with Bluepill. I see no mention of pipes in the documentation, so it could be that this functionality is not supported.

Let me know! Thank you!

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