Ubuntu Upstart script hangs on start and stop

Posted by sbwoodside on Server Fault See other posts from Server Fault or by sbwoodside
Published on 2011-03-25T20:35:22Z Indexed on 2012/09/28 3:40 UTC
Read the original article Hit count: 437

Filed under:
|
|

I have an upstart script that will start a custom jetty server. When I do sudo start [myservice] nothing happens. Subsequently, sudo status [myservice] show it as: [myservice] start/killed, process 3586.

Here's the script in /etc/init/[myservice].conf:

description "[description]"
author "[my name and email]"
start on runlevel [2345]
stop on runlevel [016]
respawn
expect fork
script
    sudo -u www-data /path/to/grafserv-start.sh >> /tmp/upstart.log 2>&1
end-script

And here is grafserv-start.sh:

#!/bin/bash
/usr/bin/java -Djetty.port=3070 -jar /path/to/grafserv/trunk/start.jar
echo "Done starting GrafServ"

I've tried redirecting the output of the script command to a tmp logfile, but that file is never created. When I start it, I just get a hang, until I ^C. Also, I tried running it with strace but that gave me a lot of stuff about sockets.

© Server Fault or respective owner

Related posts about ubuntu

Related posts about scripting