setenv.sh issue

2013-09-20 Thread vicky
Hi All,

 When i am declaring variables in my $CATALINA_BASE/bin/setenv.sh file , they 
are not getting exported :-

eg:- export NAME=e1
     export ID=22
     
But when i am declaring the same variables in $CATALINA_BASE/bin/startup.sh in 
following manner these are getting exported properly:-
eg:-
export CATALINA_OPTS=-DNAME=e1 -DID=22

Kindly suggest what is the issue in this


thanks
Vicky


Re: setenv.sh issue

2013-09-20 Thread Ognjen Blagojevic

Vicky,

On 20.9.2013 11:32, vicky wrote:

Hi All,

  When i am declaring variables in my $CATALINA_BASE/bin/setenv.sh file , they 
are not getting exported :-

eg:- export NAME=e1
  export ID=22

But when i am declaring the same variables in $CATALINA_BASE/bin/startup.sh in 
following manner these are getting exported properly:-
eg:-
export CATALINA_OPTS=-DNAME=e1 -DID=22

Kindly suggest what is the issue in this


When you say varibles, do you mean Java system properties or OS 
environment variables?


If you need to set Java system properties, use:

  export CATALINA_OPTS=-DNAME=e1 -DID=22

If you want to export OS environment variables use:

  export NAME=e1
  export ID=22

In either way, refrain from modifying startup.sh, but use setenv.sh.

Regards,
Ognjen

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh issue

2013-09-20 Thread vicky
Thanks Ognjen .

I need to set certain application specific enviornment variables ,pls suggest 
what is the best way of doing that.
eg:- configuring enviornment variable for LOG4j file path 

eg:export path=/tc/amps/logs

does above entry will be sufficient for defining in setenv.sh

Thanks
Vicky




 From: Ognjen Blagojevic ognjen.d.blagoje...@gmail.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Friday, 20 September 2013 3:42 PM
Subject: Re: setenv.sh issue
 

Vicky,

On 20.9.2013 11:32, vicky wrote:
 Hi All,

   When i am declaring variables in my $CATALINA_BASE/bin/setenv.sh file , 
they are not getting exported :-

 eg:- export NAME=e1
       export ID=22

 But when i am declaring the same variables in $CATALINA_BASE/bin/startup.sh 
 in following manner these are getting exported properly:-
 eg:-
 export CATALINA_OPTS=-DNAME=e1 -DID=22

 Kindly suggest what is the issue in this

When you say varibles, do you mean Java system properties or OS 
environment variables?

If you need to set Java system properties, use:

   export CATALINA_OPTS=-DNAME=e1 -DID=22

If you want to export OS environment variables use:

   export NAME=e1
   export ID=22

In either way, refrain from modifying startup.sh, but use setenv.sh.

Regards,
Ognjen

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: setenv.sh issue

2013-09-20 Thread Mark Eggers

On 9/20/2013 4:14 AM, vicky wrote:

Thanks Ognjen .

I need to set certain application specific enviornment variables ,pls suggest 
what is the best way of doing that.
eg:- configuring enviornment variable for LOG4j file path

eg:export path=/tc/amps/logs

does above entry will be sufficient for defining in setenv.sh

Thanks
Vicky




  From: Ognjen Blagojevic ognjen.d.blagoje...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, 20 September 2013 3:42 PM
Subject: Re: setenv.sh issue


Vicky,

On 20.9.2013 11:32, vicky wrote:

Hi All,

When i am declaring variables in my $CATALINA_BASE/bin/setenv.sh file , 
they are not getting exported :-

eg:- export NAME=e1
export ID=22

But when i am declaring the same variables in $CATALINA_BASE/bin/startup.sh in 
following manner these are getting exported properly:-
eg:-
export CATALINA_OPTS=-DNAME=e1 -DID=22

Kindly suggest what is the issue in this


When you say varibles, do you mean Java system properties or OS
environment variables?

If you need to set Java system properties, use:

export CATALINA_OPTS=-DNAME=e1 -DID=22

If you want to export OS environment variables use:

export NAME=e1
export ID=22

In either way, refrain from modifying startup.sh, but use setenv.sh.

Regards,
Ognjen


Part of my setenv.sh:

JAVA_OPTS=-Dlog4j.home=$CATALINA_BASE/logs \
   -Dderby.system.home=$CATALINA_BASE/databases
export JAVA_OPTS

Note that both of these could (should) probably go in CATALINA_OPTS.

. . . . just my two cents.
/mde/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh issue

2013-09-20 Thread Ognjen Blagojevic

Vicky,

On 9/20/2013 4:14 AM, vicky wrote:

I need to set certain application specific enviornment variables ,pls
suggest what is the best way of doing that.
eg:- configuring enviornment variable for LOG4j file path


1. Please, don't top post.

2. I doubt log4j will read any environment variables, and Stackoverflow 
confirms my doubts:


http://stackoverflow.com/questions/201188/using-system-environment-variables-in-log4j-xml-configuration

3. Make sure you understand the difference:

http://stackoverflow.com/questions/7054972/java-system-properties-and-environment-variables

4. Configure log4j using Java system properties, just like Mark suggested:


Mark:

JAVA_OPTS=-Dlog4j.home=$CATALINA_BASE/logs \
-Dderby.system.home=$CATALINA_BASE/databases
export JAVA_OPTS

Note that both of these could (should) probably go in CATALINA_OPTS.



-Ognjen

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org