Public bug reported:

If for some reason Nginx can not start, the init.d script does not
detect a problem.

=============================================================
root@vm-web1-qa4:~# su web
web@vm-web1-qa4:/root$ service nginx start
web@vm-web1-qa4:/root$ echo $?
0
web@vm-web1-qa4:/root$ ps aux | grep -v grep | grep nginx
=============================================================

Bellow I have removed /dev/null redirect to make it a bit noisy (why redirect 
to /dev/null in the first place?)
=============================================================
root@vm-web1-qa4:~# service nginx start
nginx: [emerg] open() "/var/log/nginx/domain.com/access.log" failed (2: No such 
file or directory)
root@vm-web1-qa4:~# echo $?
0
=============================================================

=============================================================
root@vm-web1-qa4:~# /etc/init.d/nginx start
nginx: [emerg] open() "/var/log/nginx/domain.com/access.log" failed (2: No such 
file or directory)
root@vm-web1-qa4:~# echo $?
0
=============================================================

In the example above I have moved /var/log/domain.com directory to
/var/log/domain.com.bk directory [ to break Nginx ] and the init.d
script does not report any error. Instead it just returns 0 for success.

This breaks a lot of scripts that depend on return codes. When there is
a problem and Nginx has not started for whatever reason, the
/etc/init.d/nginx should be able to detect it and print appropriate
error code.

Ubuntu 14.04 LTS 64 bit
Nginx 1.4.6

** Affects: nginx (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nginx in Ubuntu.
https://bugs.launchpad.net/bugs/1494183

Title:
  nginx/1.4.6 on 14.04 LTS x86_64, init.d script does not have proper
  error handling

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1494183/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to