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

Complex system command output is suppressed when jruby is executed from GlassFish. #5833

Open
annabackiyam opened this issue Aug 13, 2019 · 6 comments

Comments

@annabackiyam
Copy link

commented Aug 13, 2019

JRuby version - 9.1.13 (-Djruby.native.enabled=false)
Operating system and platform - Linux and GlassFish

Actual Problem:
The output is empty when the following script is run from GlassFish environment

#!/usr/local/bin/ruby
IO.popen(’( dbus-uuidgen > /var/lib/dbus/machine-id ; /usr/bin/Xvnc -rfbauth /etc/hosts & export DISPLAY=:0 ; ( /usr/bin/firefox & ) > /dev/null 2>&1 ; sleep 5 ; /usr/bin/killall firefox ; /usr/bin/killall Xvnc ; if [ -d /root/.mozilla ]; then echo “SUCCESS” ; else echo “FAILED” ; fi)’) {
|f| puts f.gets
}

Expected Output:
Xvnc TigerVNC 1.1.0 - built Mar 28 2016 04:48:20
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11704000, The X.Org Foundation

Tue Aug 13 21:53:21 2019
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5900
vncext: created VNC server for screen 0
SUCCESS

@kares

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

that seems like a standard embedded use-case.
maybe you could try reproducing setting up a ScriptingContainer and run the script, as a reproducer.
also did you try latest JRuby? even 9.1 had 4 releases (9.1.17) but all work is going towards 9.2 atm.

@annabackiyam

This comment has been minimized.

Copy link
Author

commented Aug 14, 2019

@kares we are using Bean Scripting Framework (BSF)

@headius

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

Hello again @annabackiyam! Is this a regression in a recent JRuby version or is this how it has always behaved?

I have not looked at BSF in a very long time, but I think like most other embedding frameworks that stdio will be shunted to in-memory streams, rather than just being dumped to the console. You should be able to configure it to use actual stdio, I think?

@annabackiyam

This comment has been minimized.

Copy link
Author

commented Aug 21, 2019

Hello @headius, the issue started only from 9.1.13. It works in the earlier version.
I do have -Djruby.native.enabled=false. That helped for simple commands and not for the complex one like this.

@headius

This comment has been minimized.

Copy link
Member

commented Sep 2, 2019

@annabackiyam Are you able to bisect when it started happening?

@annabackiyam

This comment has been minimized.

Copy link
Author

commented Sep 3, 2019

@headius Yes, I have tried that too. The commands are executed fine, just that output is empty in all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.