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

RServe loads R environment before chroot #37

Closed
rfaelens opened this issue Aug 5, 2015 · 3 comments
Closed

RServe loads R environment before chroot #37

rfaelens opened this issue Aug 5, 2015 · 3 comments

Comments

@rfaelens
Copy link

rfaelens commented Aug 5, 2015

I am trying to create a self-contained RServe in a chroot jail.
This works perfectly. However, the initial startup of RServe binds to the current /usr/lib64/R/ installation, even if the chroot environment contains another R installation.

This poses problems if the chroot environment has a different R version from the system R version.

RServe should scan the configuration file and execute any chroot before loading any other functions/libraries.

@s-u
Copy link
Owner

s-u commented Aug 5, 2015

Sorry, I'm not quite sure I understand the issue - you are setting the environment before Rserve is started (typically using R CMD) - it merely uses the R home defined by the environment. Normally, the way chrooted Rserve is used to have the corresponding R setup in the chroot which is typically a subset of the system R. Rserve doesn't "bind" anything itself, it's being linked against whatever R is available - and that happens before it's even run, so it has no control over that. If you want to have an entirely different R setup in your chroot jail, then you have to first chroot into the jail and then start Rserve - there is nothing Rserve itself can do to make that happen itself since it's linked to whatever R you start it with.

@rfaelens
Copy link
Author

Thanks for the comment.

Indeed the right approach is to use LD_PRELOAD or other ld "tricks" to make sure RServe binds with the right R dll when run in a chroot environment. RServe links to whatever R the dynamic loader picks out, which is typically the system R.

You can close this as a "won't fix", we will try to make it work by either using LD_PRELOAD or by writing a wrapper to chroot first.

@s-u
Copy link
Owner

s-u commented Sep 18, 2015

LD_PRELOAD doesn't sound quite right. R controls the locations that will be loaded using via R_HOME_DIR in the initial script and then $R_HOME_DIR/etc/ldpaths for the location of libraries, so I would rather make sure those are setup correctly instead.

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