Ubuntu – How to troubleshoot Upstart Unknown job error


I set up nginx according to instructions here and it all went well but I am unable to start with

$ start <my app name>

I created /etc/init/nomilkfor.me.conf (this is the domain name) and this is what is in the file:

description "ubuntu 13.10 on Samsung laptop"
author "zeynel"
start on startup
stop on shutdown
setuid deploy
chdir /deploy
console log
env PORT=4000
exec java -jar my-webapp-0.1.0-standalone.jar

I reload nginx with

$ sudo nginx -s reload

and I try

$ start nomilkfor.me

but I get 

start: Unknown job: nomilkfor.me

What am I doing wrong?

I also tried to open the log files in /var/log/upstart but I could not open them with nano.


For some reason blank lines in the nomilkforme.conf was throwing "Unknown stanza" error. I removed those lines and changed start on startup to start on (local-filesystems and net-device-up IFACE=eth0) as per this page and now I get

z@ubuntu:/$ start nomilkforme
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.86" (uid=1000 pid=17258 comm="start nomilkforme ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

Can you help understanding what this means?


Apparently the error above was triggered because I did not use "sudo" but with with sudo I get this (also with this try I reinstated start on startup)

z@ubuntu:/$ sudo start nomilkforme
[sudo] password for z: 
start: Job failed to start

Best Answer

I've found at least two reasons for this error message: the first is a syntax error and the second is that the conf file didn't exist when you booted so Upstart will refuse to run it.

To make sure your conf file syntax is correct run:

init-checkconf -d /etc/init/script.conf

It will print out a bunch of stuff and near the end it should say:

File /etc/init/script.conf: syntax ok

If the conf file syntax is ok but job still won't start the only way I've gotten Upstart to recognize the file is to reboot.

Related Question