nginx/1.4.6 on 14.04 LTS x86_64, init.d script does not have proper error handling
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nginx (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
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-
web@vm-
0
web@vm-
=======
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/
root@vm-web1-qa4:~# echo $?
0
=======
=======
root@vm-web1-qa4:~# /etc/init.d/nginx start
nginx: [emerg] open() "/var/log/
root@vm-web1-qa4:~# echo $?
0
=======
In the example above I have moved /var/log/domain.com directory to /var/log/
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