You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julien Oix <ju...@presidence.univ-nantes.fr> on 2003/11/24 13:36:59 UTC

How to set the user runnig tomcat ? ( + start/stop problem)

Hi everyone,

I used to run a tomcat 4.1.18 rpm on a linux top box, where I put the
TOMCAT_USER variable in a tomcat4.conf file ( nobody user in my case ...)

Now i try to upgrade to 4.1.29 full archive (jakarta-tomcat-4.1.29.tar.gz)
and I didn't see any doc's on configuring this variable ..

Is the only solution to execute the startup.sh script as the running user ?
( the command line under a root session could be : su - nobody -c
$CATALINA_HOME/bin/startup.sh )

Another problem:

I start tomcat with the method up in the message:

root@miles # su - nobody -c $CATALINA_HOME/bin/startup.sh
Using CATALINA_BASE:   /var/tomcat
Using CATALINA_HOME:   /var/tomcat
Using CATALINA_TMPDIR: /var/tomcat/temp
Using JAVA_HOME:       /usr/java/java
root@miles # ps -aux

--> gives the process ran by nobody ...

root@miles # su - nobody -c $CATALINA_HOME/bin/shutdown.sh
Using CATALINA_BASE:   /var/tomcat
Using CATALINA_HOME:   /var/tomcat
Using CATALINA_TMPDIR: /var/tomcat/temp
Using JAVA_HOME:       /usr/java/java
Catalina.stop: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:452)
        at java.net.Socket.connect(Socket.java:402)
        at java.net.Socket.<init>(Socket.java:309)
        at java.net.Socket.<init>(Socket.java:124)
        at org.apache.catalina.startup.Catalina.stop(Catalina.java:581)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

And the tomcat processes are always running ...

Any ideas ? ( i added the correct env in /etc/profile for every user)

Thanks in advance :-)

Julien OIX
Service Informatique de Gestion - Université de Nantes
Tel: 02 40 99 83 65 / abroad + (33) 240 99 83 65
Web: http://www.univ-nantes.fr
mailto:julien.oix@presidence.univ-nantes.fr


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How to set the user runnig tomcat ? ( + start/stop problem)

Posted by Timothy Stone <ci...@petmystone.com>.
Julien,

If I can just provide you some feedback, at least if only to let you 
know that someone is reading and following this thread. :)

I'm am trying to do the same, not on Linux but Mac OS X. I'm very 
interested in this as well. That said, allow me to provide some comments 
on your post:

Julien Oix wrote:

> I used to run a tomcat 4.1.18 rpm on a linux top box, where I put the
> TOMCAT_USER variable in a tomcat4.conf file ( nobody user in my case ...)

As an RPM, the tomcat4.conf file probably provides variables that are 
passed to the init.d scripts for startup and shutdown.

> Now i try to upgrade to 4.1.29 full archive (jakarta-tomcat-4.1.29.tar.gz)
> and I didn't see any doc's on configuring this variable ..

As noted, the tomcat4.conf file is a Linux convention, likely for 
convenience. This file is not going be in the binary distribution of 
Tomcat from Jakarta.

I would like to request a copy of both the conf file and the init.d 
script loaded by the RPM. It may provide clues valuable in your quest 
and my quest on Mac OS X.

In Mac OS X, similar to the init.d scripts, a script is placed in a 
StartupItems folder and executed as root. However, as one might guess, 
this results in the process being owned by root. I have not found a 
working method of changing this, including, as you suggest below:

> Is the only solution to execute the startup.sh script as the running user ?
> ( the command line under a root session could be : su - nobody -c
> $CATALINA_HOME/bin/startup.sh )

Thus, the reason I request the conf and init.d script files. Valuable 
clues may be found in each that could help us both.

> 
> Another problem:
> 
> I start tomcat with the method up in the message:
> 
> root@miles # su - nobody -c $CATALINA_HOME/bin/startup.sh
> Using CATALINA_BASE:   /var/tomcat
> Using CATALINA_HOME:   /var/tomcat
> Using CATALINA_TMPDIR: /var/tomcat/temp
> Using JAVA_HOME:       /usr/java/java
> root@miles # ps -aux
> 
> --> gives the process ran by nobody ...
> 
> root@miles # su - nobody -c $CATALINA_HOME/bin/shutdown.sh
> Using CATALINA_BASE:   /var/tomcat
> Using CATALINA_HOME:   /var/tomcat
> Using CATALINA_TMPDIR: /var/tomcat/temp
> Using JAVA_HOME:       /usr/java/java
> Catalina.stop: java.net.ConnectException: Connection refused
> java.net.ConnectException: Connection refused

...snip stacktrace...

> 
> And the tomcat processes are always running ...
> 
> Any ideas ? ( i added the correct env in /etc/profile for every user)
> 

I'm not sure why you would not be able to stop the process as started. 
Hmmm...

Look forward to hearing from you and others.

Warmest Regards,
Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org