init script fails with error code 0 when configuration test doesn't pass

Bug #1413555 reported by Stratos Moros on 2015-01-22
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
nginx (Ubuntu)
Low
Unassigned
Trusty
Low
Unassigned
Utopic
Undecided
Unassigned
Vivid
Low
Unassigned

Bug Description

Ubuntu version: Ubuntu 14.04.1 LTS
Nginx version: 1.4.6-1ubuntu3.1

Steps to reproduce:

1. install nginx
2. add a configuration error to nginx's configuration (echo error > /etc/nginx/nginx.conf)
3. reload nginx and check its exit code (/etc/init.d/nginx reload; echo $?)

What should happen:

Nginx should fail to reload with a non zero exit code.

What happens instead

Nginx does not reload, but the init script's exit code is 0. This confuses certain configuration management tools that rely on init scripts' exit codes to determine success.

Thomas Ward (teward) wrote :

Confirmed in 1.4.6-1ubuntu3.2 from trusty-updates. Not tested with later releases.

I'm marking this as "Confirmed" against Trusty, however it needs testing in Utopic and Vivid to determine the full extent of what's affected.

Changed in nginx (Ubuntu):
status: New → Confirmed
Changed in nginx (Ubuntu Trusty):
status: New → Confirmed
Thomas Ward (teward) wrote :

Also, please elaborate what you mean by 'certain configuration management tools' - unless they're used regularly by a substantial portion of existence (such as a well known configuration management tool) then I'm not sure the actual impact.

Until that's clarified, I'm marking importance on this as "Low" against the nginx package as it doesn't necessarily effect the operation of the package or executable.

Changed in nginx (Ubuntu):
importance: Undecided → Low
Changed in nginx (Ubuntu Trusty):
importance: Undecided → Low
Changed in nginx (Ubuntu):
status: Confirmed → New
Thomas Ward (teward) wrote :

Confirmed that Vivid is not affected. Log data:

teward@vivid-server-vm:~$ sudo service nginx restart; echo $?
Job for nginx.service failed. See "systemctl status nginx.service" and "journalctl -xe" for details.
1

Changed in nginx (Ubuntu Vivid):
status: New → Invalid
Stratos Moros (stmoros) wrote :

Hello Thomas and thanks for taking an interest

Personally, I experienced the bug using Ansible, which I would argue is well known.

Joó Ádám (s-adam-i) wrote :

Please see the bug report for Ansible: https://github.com/ansible/ansible-modules-core/issues/952

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nginx (Ubuntu Utopic):
status: New → Confirmed
Joó Ádám (s-adam-i) wrote :

Also, this is not specific to Nginx.

Thomas Ward (teward) wrote :

If this is not specific to NGINX there needs to be additonal bugs opened against the other projects. This bug will only address NGINX.

This seems specific to the init scripts packaged with the .deb for NginX to me. Unless there is an automated system creating these init-scripts and omitting the exit-codes on failure.

Thomas Ward (teward) wrote :

Ubuntu Utopic has gone End of Life as of today. As such, this bug is being marked Won't Fix against the Utopic package.

Refer to: https://lists.ubuntu.com/archives/ubuntu-announce/2015-July/000198.html

Changed in nginx (Ubuntu Utopic):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers