Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I rent a CentOS 6 VPS and wish to install Jetty on it so I can use Solr for a project I've been working on.

I've been following this jetty tutorial to install Jetty on my VPS, however when I try to start Jetty using service jetty start or /etc/init.d/jetty start I receive the following error(s):

Starting Jetty: grep: /var/run/jetty.state: No such file or directory
grep: /var/run/jetty.state: No such file or directory
grep: /var/run/jetty.state: No such file or directory
FAILED Sat Apr 20 00:21:56 BST 2013

I've looked in the logs and it doesn't look like anything is added to them regarding more information about this error. This is what my Jetty config file looks like:

JAVA_HOME=/usr/bin
JAVA=$JAVA_HOME/java
JAVA_OPTIONS=" -server -Xms256m -Xmx1024m -XX:+DisableExplicitGC "
JETTY_HOME=/srv/jetty
JETTY_USER=jetty
JETTY_PORT=7070
JETTY_HOST=localhost
JETTY_LOGS=/srv/jetty/logs/

Has anyone experienced this before and can point me in the right direction as to what I need to do to resolve it?

share|improve this question

2 Answers 2

After hitting this problem, I found that jetty.state must be writable to the java process. So if you are not running jetty as root, /var/run will not be writable and you'll have this problem.

My solution is to create a directory where jetty can write, like /opt/jetty/run and put it into /etc/default/jetty file:

JETTY_RUN=/opt/jetty/run/
share|improve this answer

Based on the tutorial at http://www.copper-arrow.com/blog/jetty-web-server-centos-6

  1. in /etc/init.d/jetty or /srv/jetty/bin/jetty.sh find and replace a string

    rm -f $JETTY_STATE
    

    to

    #rm -f $JETTY_STATE
    
  2. in terminal:

    service jetty supervise

    after several seconds press Ctrl+C and than

    service jetty restart

share|improve this answer
    
Didn't help me. Jetty 9.0.2 –  ruslan May 2 '13 at 19:22

Your Answer

 
discard

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.