Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've added a new script to /etc/init/ called minecraft.conf which contains the script:

start on startup
stop on shutdown
respawn limit 20 5

  export HOME="/root"
  exec /root/minecraft/ 2>&1 >> /var/log/minecraft.log
end script

post-start script
   echo "minecraft started"

When I try start minecraft I get the error: start: Unknown job: minecraft

I've tried running initctl list and my minecraft job is not listed. I've tried running initctl reload-configuration and it doesn't make any difference.

Other jobs listed by initctl list work fine with start, stop and restart.

Why won't upstart see my new script?

share|improve this question
This might be a stupid question but... shuldn't be your script in /etc/init.d/? – Wolfer Jan 24 '13 at 17:09
@snow thanks, but I've already read that and I still have the problem. – Jasarien Jan 24 '13 at 17:19
@Wolfer according to the upstart getting started guide, it says "Once happy, place the files in /etc/init and now you're ready to reboot and use upstart." – Jasarien Jan 24 '13 at 17:20
I tried to reproduce the problem but with no success. I copy pasted your code to /etc/init/minecraft.conf and issued sudo start minecraft without a problem. Here is content of the log file ~$ sudo cat /var/log/upstart/minecraft.log minecraft started /proc/self/fd/9: 3: exec: /root/minecraft/ not found minecraft started Can you provide more details on Ubuntu version you are using and any useful information from syslog? – Goran Miskovic Jan 24 '13 at 19:10
up vote 6 down vote accepted

I feel kinda dumb... But here it is:

I missed the "end script" stanza from the very end of the upstart script...

post-start script
   echo "minecraft started"

should have been

post-start script
   echo "minecraft started"
end script

I'm not sure why it worked for @schkovich without the end script, though...

share|improve this answer
Because I added end script stanza. Built in (mind) auto code completion. :( – Goran Miskovic Jan 27 '13 at 8:48
That explains that then. ;) – Jasarien Jan 28 '13 at 9:28
I hit the same problem but infuriatingly, nothing appears in /var/log and initctl reload-configuration --verbose is silent. – Neil McGill Dec 2 '15 at 17:05

Check the upstart logs (it's in /var/log/syslog) while reloading the configuration using initctl reload-configuration. If there is a syntax error, it will show up there. That's usually why you cannot use your new upstart configuration.

share|improve this answer

An easy way to check your script syntax is with the following command:

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

I've found that even with a valid Upstart file if the file didn't exist when the server was booted last I have to reboot the server for Upstart to see the file.

share|improve this answer

In my case it was an empty author field, like this:

author ""

It worked only after adding something in the quotes.

# initctl reload-configuration

was also throwing /etc/init/servicename.conf:2: Expected token to syslog instead of stdout. Too busy to file a bug report for a dying package.

share|improve this answer

Your Answer


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.