I was just bitten by this myself. For what it's worth, in Ansible, I got around it with doing this immediately after the nginx package install (this essentially Lior's solution, converted into Ansible tasks):
--- # We need to remove the Upstart config, which is conflicting with the also-included systemV init.d config # Re: https://bugs.launchpad.net/nginx/+bug/1476296
- name: Stop nginx (as managed by upstart) command: initctl stop nginx
- name: Remove the upstart init command file: state=absent path=/etc/init/nginx.conf
- name: ensure that Nginx will start on restarts with systemV command: update-rc.d nginx defaults
- name: ensure that nginx is started service: name=nginx state=started
I was just bitten by this myself. For what it's worth, in Ansible, I got around it with doing this immediately after the nginx package install (this essentially Lior's solution, converted into Ansible tasks):
--- /bugs.launchpad .net/nginx/ +bug/1476296
# We need to remove the Upstart config, which is conflicting with the also-included systemV init.d config
# Re: https:/
- name: Stop nginx (as managed by upstart)
command: initctl stop nginx
- name: Remove the upstart init command init/nginx. conf
file: state=absent path=/etc/
- name: ensure that Nginx will start on restarts with systemV
command: update-rc.d nginx defaults
- name: ensure that nginx is started
service: name=nginx state=started