Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7789911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:26:09+00:00 2026-06-01T21:26:09+00:00

i needed to change the tomcat process to be executed by non root user.

  • 0

i needed to change the tomcat process to be executed by non root user. created user tomcat and put that in tomcat_group group. changed permissions. and then changed the startup script in init.d.

My old script which is running as a root user is

#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.6.0_31
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat-7.0.26


case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;; 
stop)   
sh $CATALINA_HOME/bin/shutdown.sh
;; 
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;; 
esac    
exit 0

This is running fine as a root user.

New script is that

    #!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.6.0_31
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat-7.0.26/bin


case $1 in
start)
/bin/su tomcat $CATALINA_HOME/startup.sh
;; 
stop)   
/bin/su tomcat $CATALINA_HOME/shutdown.sh
;; 
restart)
/bin/su tomcat $CATALINA_HOME/shutdown.sh
/bin/su tomcat $CATALINA_HOME/startup.sh
;; 
esac    
exit 0

but this gives error when start my service
unable to find whats the issue

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:26:11+00:00Added an answer on June 1, 2026 at 9:26 pm

    This is most likely a result of changing the $CATALINA_HOME variable to be the /bin.

    The startup.sh calls the catalina.sh script which depends on the $CATALINA_HOME being a specific directory. I’d definitely recommend changing it back to CATALINA_HOME=/usr/share/apache-tomcat-7.0.26 and then adding /bin back into the command calls. Tomcat relies heavily on the CATALINA_HOME environment variable.

    Hope that helps.

    EDIT: You still need to take into account Mat’s answer, this should just fix the file not found error you are now getting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently decided that I needed to change from using milliseconds to microseconds for
I had to change some code that was created by another person in VS2008,
I needed to create some PDF document , that can set background color of
We needed to monitor all processes Registry calls/File Sytem calls/Process creations in the system
I needed to find all the files that contained a specific string pattern. The
I needed a generic collection or list that can fire an event when an
I needed to change the SID of an Oracle XE database (not the Service
I have an Xcode project and needed to change the name of the product
I'm in charge of developing and maintaining a group of Web Applications that are
my case is one thread read and want to decide if needed to change

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.