You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Turner, Robbin J" <Ro...@boeing.com> on 2010/01/07 00:07:50 UTC

How to set User.dir or CWD for Solr during Tomcat startup

Is there anyway to force the cwd that solr starts up in when using the standard startup scripts for tomcat?  I'm working on solaris and using the SMF to start and stop tomcat sets the path to /root.  I've been doing a bunch of googling and haven't seen if there is a parameter to set within Tomcat other than the solr/home which is setup in the solr.xml under the $CATALINA_HOME/conf/Catalina/localhost/.

I've had one person give me instructions using the Gui on windows, but I'm at a loss on which configuration file that would set that or which environment variable can or should be defined.

Any help would be appreciated.

Thanks
Robbin


RE: How to set User.dir or CWD for Solr during Tomcat startup

Posted by Chris Hostetter <ho...@fucit.org>.
: That's just setting the solr/home environment not the user.dir variable.  
: I have that already set.  But when I got to the solr/admin page, at the 
: top it shows the Solr Admin(schemaname), hostname, and cwd=/root, 
: SolrHome=/opt/solr.
: 
: How do I get cwd=/root not to be that but to be set to /opt/solr?


1) to the best of my knowledge it is not physically possible for a java 
app to set user.dir once it's started...
   http://www.devx.com/tips/Tip/13804
...you wouldh ave to chnage the directory in whatever shell/batch script 
you use to start tomcat

2) it shouldn't matter.  Solr should be using solr.solr.home (aka: 
the solr/home JNDI) property for just about everything ... the CWD listed 
on the admin screens is largely just informative.  some places in solr 
will still look for files in the CWD as a fallback, but they should be 
checking solr.solr.home and hte conf dir first -- i think <dataDir/> is 
the one place where "relative' paths are evaluated relative the CWD 
instead of the solr.solr.home, so if you wnat to set that to something 
else you may need to use an absolute path.




-Hoss


RE: How to set User.dir or CWD for Solr during Tomcat startup

Posted by "Turner, Robbin J" <Ro...@boeing.com>.
That's just setting the solr/home environment not the user.dir variable.  I have that already set.  But when I got to the solr/admin page, at the top it shows the Solr Admin(schemaname), hostname, and cwd=/root, SolrHome=/opt/solr.

How do I get cwd=/root not to be that but to be set to /opt/solr?

robbin

-----Original Message-----
From: Olivier Dobberkau [mailto:olivier.dobberkau@dkd.de] 
Sent: Thursday, January 07, 2010 3:28 AM
To: solr-user@lucene.apache.org
Subject: Re: How to set User.dir or CWD for Solr during Tomcat startup


Am 07.01.2010 um 00:07 schrieb Turner, Robbin J:

> I've been doing a bunch of googling and haven't seen if there is a parameter to set within Tomcat other than the solr/home which is setup in the solr.xml under the $CATALINA_HOME/conf/Catalina/localhost/.

Hi.

We set this in solr.xml

<Context docBase="/opt/solr-tomcat/apache-tomcat-6.0.20/webapps/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String" value="/opt/solr-tomcat/solr" override="true" /> </Context>

http://wiki.apache.org/solr/SolrTomcat#Simple_Example_Install

hope this helps.

olivier

--

Olivier Dobberkau
. . . . . . . . . . . . . .
Je TYPO3, desto d.k.d


Re: How to set User.dir or CWD for Solr during Tomcat startup

Posted by Olivier Dobberkau <ol...@dkd.de>.
Am 07.01.2010 um 00:07 schrieb Turner, Robbin J:

> I've been doing a bunch of googling and haven't seen if there is a parameter to set within Tomcat other than the solr/home which is setup in the solr.xml under the $CATALINA_HOME/conf/Catalina/localhost/.

Hi.

We set this in solr.xml

<Context docBase="/opt/solr-tomcat/apache-tomcat-6.0.20/webapps/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String" value="/opt/solr-tomcat/solr" override="true" />
</Context>

http://wiki.apache.org/solr/SolrTomcat#Simple_Example_Install

hope this helps.

olivier

--

Olivier Dobberkau
. . . . . . . . . . . . . .
Je TYPO3, desto d.k.d