EC2 linux any and all upstart jobs returning “unrecognised service”

amazon ec2amazon-web-servicesupstart

Having a nightmare migrating some upstart jobs from Ubuntu to EC2 Linux (ElasticBeanstalk)

I am unable to get even the most basic task to work. I am using the script below which works perfectly on Ubuntu but returns the very unhelpful "unrecognised service" when I try to start it in EC2 Linux. I have read this is usually a syntax error but that doesnt follow if this is syntactically OK for Ubuntu. Any help massively appreciated, I just need any working example.

This is in /etc/init/test.conf created as root user.

Console:

# sudo service test start
# test: unrecognized service

/etc/init/test.conf:

description "test"

start on startup

script
  echo $(ping -c 1 serverfault.com) > /var/log/testjob.log
end script

Best Answer

So for some reason initctl likes it and service doesnt...

sudo initctl start test
test start/running, process 8776

A bug in EC2 Linux me thinks. My example exactly conforms to the documentation but no biggy to switch to using initctl

If you like to check which services are running you also can do this:

sudo initctl list

And to verify where the log error read the file in /var/log/messages

Related Topic