Question

How to resole code exited status 127

As I mentioned I’m unable to start tomcat server when i’m seeing status of tomcat server it is showing Main PID: 2397 (code=exited, status=127)


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @raghuDolphin,

Status 127 can mean a variety of stuff. It’s not really an exit code from which we can fully provide a correct solution/direction.

What I’ll suggest is either checking the logs or your service’s status.

Let’s start with the status first. Try doing the following:

systemctl restart tomcat
systemctl status tomcat

In the status you should be able to see an error somewhere. What does this error say?

If you do not see the error, then turn your attention to Tomcat’s logs. By default logs should be stored in /var/log. Depending on your version the logs can be in

/var/log/tomcat6
/var/log/tomcat7
/var/log/tomcat8
/var/log/tomcat9

If you are not sure your version, you can type the following command to try and narrow it down:

find /var/log -name 'tomcat*'
find /var/log -name '*tomcat*'

In those logs, you should see the exact reason behind the failure. If you are not sure, you can always provide the error here and we’ll try and help out.

Regards, KFSys