Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

JETTY_HOME + JETTY_USER not being set #8

Closed
nozpheratu opened this issue Jan 29, 2014 · 3 comments
Closed

JETTY_HOME + JETTY_USER not being set #8

nozpheratu opened this issue Jan 29, 2014 · 3 comments

Comments

@nozpheratu
Copy link

Is this perhaps an issue with my setup? Jetty manages to install everything but doesn't set the JETTY_HOME or JETTY_USER environment variables. Running echo $JETTY_HOME or echo $JETTY_USER returns blank values.

@lbdremy
Copy link
Member

lbdremy commented Jan 30, 2014

Hi @nozpheratu,

The file containing these variables is generated here https://github.com/hipsnip-cookbooks/jetty/blob/master/recipes/default.rb#L204 (with this template https://github.com/hipsnip-cookbooks/jetty/blob/master/templates/default/jetty.default.erb), you should be able to find it at /etc/default/jetty. The variable are exported while running the init.d script here for Jetty 8 and here for Jetty 9.

Could you check these files are there and well generated, sorry that's hard to help you more here.
Also you can try /etc/init.d/jetty status to see the variables imported. Yes also you need to source /etc/default/jetty with . /etc/default/jetty before you can print the variables with echo $JETTY_HOME. Does it help?

@nozpheratu
Copy link
Author

Hey @lbdremy, thanks for the response. I had a look at /etc/default/jetty, and it looks like the variables are in fact defined:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JETTY_HOME=/usr/share/jetty
export JETTY_USER=jetty
export JETTY_PORT=8983
export JETTY_ARGS="-Djetty.port=8983 -Djetty.logs=/var/log/jetty"
export JAVA_OPTIONS="-Dsolr.data.dir=/usr/local/solr/data -Dsolr.solr.home=/usr/share/solr -Djava.util.logging.config.file=/usr/share/jetty/etc/logging.properties"
export JETTY_LOGS="/var/log/jetty"

Sorry, I'm new to this whole sys-admin thing, but what do you mean when you say "you need to source /etc/default/jetty with . /etc/default/jetty". Will this have to happen every time I login? If so, how do I go about making them permanent.

@lbdremy
Copy link
Member

lbdremy commented Jan 30, 2014

The dot is a command similar to source so . /etc/default/jetty is equivalent to source /etc/default/jetty, this command executes the content of the file passed as argument, in the current shell, in our case you get the variables loaded into your current environment. The init.d script for starting jetty does this every time it is run so it gets these variable into its environment and the environment of its children processes (notice the env variable are shared with the children not the parent). So yes you have to source the file every time you log-in, you can source the file at login in by adding the source line into the file ~/.bashrc or a similar file depending on your distribution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants