Starting Jetty: FAILED

It is literally 23:19 on a Sunday and I've been working through the weekend to get a release out of some software I'm working on.

The Java application webserver (Jetty) was taking a long time to restart each time I did a change, so for some reason I thought I'd experiment with some new command-line options. Probably not the right time to do that.

Normally I would type

$ sudo  /etc/init.d/jetty6 restart
Stopping Jetty: OK
Starting Jetty: OK

and everything would be good. I tried typing

$ sudo /etc/init.d/jetty6 supervise

Then some stuff happened that I didn't really understand. Rather than try and work out what it did I tried to restart it again using the old restart mechanism

$ sudo  /etc/init.d/jetty6 restart
...
Starting Jetty: FAILED

OK I mean that was basically what was going on, it just wrote FAILED. How helpful! There was no info in the logfile. I searched Google but didn't come up with anything.

A reboot later, and about half an hour of looking into /etc/init.d/jetty6 with vi and randomly making changes and printing more stuff out yielded the fact that the "supervise" command had evidently run Jetty "as me" and not as the "jetty" user. So when the normal "restart" command came along and tried to run the program as "jetty" then there were files it couldn't write to.

Solution:

$ sudo chown jetty /var/log/jetty6/2009_07_12.stderrout.log
P.S. I recently created a nerdy privacy-respecting tool called When Will I Run Out Of Money? It's available for free if you want to check it out.

This article is © Adrian Smith.
It was originally published on 12 Jul 2009
More on: Jetty | FAIL