I am deploying a server using Chef 11.10; the operating system is Amazon Linux AMI 2016.03 (we use EC2/OpsWorks), which uses Upstart.
In our recipe we trigger a start of the server, because we need it running to issue some configuration commands. Unfortunately, this fail if the server is already running because in that case sudo start <job>
returns 1
instead of 0
(i.e. it's not idempotent).
It looks like Chef is not handling this case, or not checking if the server is already running.
What would be an easy way to fix this?