Server Fault is a question and answer site for system and network administrators. 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 want to start my tomcat server automatically on startup. Therefore I retrieved a simple LSB conform script from the net and modified it to my needs. This is the script:

# Provide logging functions like log_success_msg, log_failure_msg and log_warning_msg
. /lib/lsb/init-functions

[ -f /etc/default/rcS ] && . /etc/default/rcS

case "$1" in
        log_failure_msg "Usage: {start|stop|restart|force-reload|status}"
                exit 1

exit 0

Now, I copied it to /etc/init.d and applied a "chmod +x tomcat" on it. Then I tried to run it

/etc/init.d # ./tomcat start
/opt/apache-tomcat-7.0.39/bin/ 1: /opt/apache-tomcat-7.0.39/bin/ uname: not found
/opt/apache-tomcat-7.0.39/bin/ 1: /opt/apache-tomcat-7.0.39/bin/ dirname: not found
Cannot find /
The file is absent or does not have execute permission
This file is needed to run this program

What am I missing here?

share|improve this question


uname: not found
dirname: not found

show that you're missing a proper PATH.

Try changing the PATH line in your startup script to: PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/jdk1.7.0_21:/opt/apache-tomcat-7.0.39

share|improve this answer

THis is the issue


You forgot to append $PATH to that.. it must be


share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.