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...
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:
And to verify where the log error read the file in
/var/log/messages