Hello Dan and thank you for your answer.

I installed the JSVC tool as indicated in your document
http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Unix_daemon

I copied the "jsvc" executable into "/opt/tomcat7/bin/".

I also copied "/opt/tomcat7/bin/daemon.sh" into "/etc/init.d" and renamed it
as "tomcat7".

I added the following lines at the beginning of "/etc/init.d/tomcat7":
-------------------------------------------------------------------------
CATALINA_HOME=/opt/tomcat7
export CATALINA_HOME
TOMCAT_USER=webadmin
export TOMCAT_USER
JAVA_HOME=/opt/jdk1.7.0_67
-------------------------------------------------------------------------

I hope I did all this the right way... ?

Now, if I reboot, log in as root and launch the command:
root> ps aux | grep tomcat7

I notice that there are two "jsvc.exec" processes, one run by "root" and the
other one run by "webadmin" which UID is 1000:

-------------------------------------------------------------------------
root      2841  0.0  0.0  16752   412 ?        Ss   16:30   0:00 jsvc.exec
-java-home /opt/jdk1.7.0_67 -user webadmin -pidfile
/opt/tomcat7/logs/catalina-daemon.pid -wait 10 -outfile
/opt/tomcat7/logs/catalina-daemon.out -errfile &1 -classpath
/opt/tomcat7/bin/bootstrap.jar:/opt/tomcat7/bin/commons-daemon.jar:/opt/tomcat7/bin/tomcat-juli.jar
-Djava.util.logging.config.file=/opt/tomcat7/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs= -Dcatalina.base=/opt/tomcat7
-Dcatalina.home=/opt/tomcat7 -Djava.io.tmpdir=/opt/tomcat7/temp
org.apache.catalina.startup.Bootstrap

1000      2842  8.9  1.1 2434512 97444 ?       Sl   16:30   0:03 jsvc.exec
-java-home /opt/jdk1.7.0_67 -user webadmin -pidfile
/opt/tomcat7/logs/catalina-daemon.pid -wait 10 -outfile
/opt/tomcat7/logs/catalina-daemon.out -errfile &1 -classpath
/opt/tomcat7/bin/bootstrap.jar:/opt/tomcat7/bin/commons-daemon.jar:/opt/tomcat7/bin/tomcat-juli.jar
-Djava.util.logging.config.file=/opt/tomcat7/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs= -Dcatalina.base=/opt/tomcat7
-Dcatalina.home=/opt/tomcat7 -Djava.io.tmpdir=/opt/tomcat7/temp
org.apache.catalina.startup.Bootstrap
-------------------------------------------------------------------------

If I "kill -9" the process owned by user 1000, another process is
immediately created to replace the killed one.

If I kill the process owned by "root", no new process is created. 
And if I kill the last remaining process, the one owned by user 1000, no new
process is created either.

I noticed that the $CATALINA_PID file contain the PID of the process owned
by user 1000.

I am wondering if this is normal behavior and if it is, why is it behaving
like this?

Thank you for helping.
Best regards.



--
View this message in context: 
http://tomcat.10.x6.nabble.com/How-can-Tomcat-be-started-at-boot-time-as-a-non-root-user-tp5023810p5023823.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

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

Reply via email to