I'm using AWS and have a setup script that runs after EC2 instance creation. It installs a bunch of packages, writes some config files, etc. It's been working well for a while. Now, nginx fails to successfully restart after it writes the config:
> sudo service nginx restart
nginx start/running, process 26742
start: Job is already running: nginx
Just trying to stop nginx also fails:
> sudo service nginx stop
nginx start/running, process 26762
The process does stop, but is immediately restarted with a new PID.
I'm not sure why this just started happening. I've created many instances, and it happens each time. The EC2 AMI hasn't changed (ubuntu-precise-12.04-amd64-server-20150401). I had been using nginx/development, but the same problem happens when I switched to nginx/stable.
One more datapoint: uninstalling nginx will, of course, allow me to stop it, but reinstalling the package brings back the same problem.
It looks like a duplicate of this question, but the proposed solution there does not work.
Any help is appreciated!