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 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 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/ start" nobody when starting tomcat. (nobody is the user in this case that tomcat will start under)

share|improve this answer

You should not copy to /etc/init.d/tomcat. Ubuntu provides (in its tomcat6 package) a /etc/init.d/tomcat6 startup script that will invoke 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


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