title: Rstudio-server environment variables not loading?
body: <p>I'm trying to run rhadoop on Cloudera's hadoop distro (I can't remember if its CDH3 or 4), and am running into an issue: Rstudio server doesn't seem to recognize my global variables.</p>
  
  <p>In my /etc/profile.d/r.sh file, I have:</p>
  
  <pre><code>export HADOOP_HOME=/usr/lib/hadoop
  export HADOOP_CONF=/usr/hadoop/conf
  export HADOOP_CMD=/usr/bin/hadoop
  export HADOOP_STREAMING=/usr/lib/hadoop-mapreduce/
  </code></pre>
  
  <p>When I run R from the terminal, I get:</p>
  
  <pre><code>&gt; Sys.getenv("HADOOP_CMD")
  [1] "usr/bin/hadoop"
  </code></pre>
  
  <p>But when I run Rstudio server:</p>
  
  <pre><code>&gt; Sys.getenv("HADOOP_CMD")
  [1] ""
  </code></pre>
  
  <p>And as a result, when I try to run rhdfs:</p>
  
  <pre><code>&gt; library("rJava", lib.loc="/home/cloudera/R/x86_64-redhat-linux-gnu-library/2.15")
  &gt; library("rhdfs", lib.loc="/home/cloudera/R/x86_64-redhat-linux-gnu-library/2.15")
  Error : .onLoad failed in loadNamespace() for 'rhdfs', details: 
      call: fun(libname, pkgname)
      error: Environment variable HADOOP_CMD must be set before loading package rhdfs
  Error: package/namespace load failed for 'rhdfs'
  </code></pre>
  
  <p>Does anyone know where I should be putting my enviornment variables if not in that specific r.sh file?</p>
  
  <p>Thanks!</p>