Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I copy catalina.sh to /etc/init.d/tomcat and sudo chkconfig --add tomcat it started as root user,I want use another user,how?

share|improve this question

migrated from stackoverflow.com Aug 10 '11 at 5:54

This question came from our site for professional and enthusiast programmers.

If you do want to create your own start up script for whatever reason. Then to run tomcat under another user use su -c "$TOMCAT_HOME/bin/tomcat.sh start" nobody when starting tomcat. (nobody is the user in this case that tomcat will start under)

http://www.jguru.com/faq/view.jsp?EID=455567

share|improve this answer

You should not copy catalina.sh to /etc/init.d/tomcat. Ubuntu provides (in its tomcat6 package) a /etc/init.d/tomcat6 startup script that will invoke catalina.sh as the correct user.

Also, using chkconfig on Ubuntu is not supported; it's a script for Red Hat-based systems. Don't use it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.