I just compiled the last Nginx version (1.7) on my debian 7.4 machine based on different web posts and docs merged here. It works fine. I also need to change the startup job to target the new Nginx executable. The result is that I can start but can't stop the http sever with the service command.
Nginx 1.7.0 executable location :
/opt/nginx/sbin/nginx.
I removed the previous initd run nlevels configuration by type in
sudo update-rc.d nginx remove
in /etc/init.d/nginx I replaced these two lines :
# PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# DAEMON=/usr/sbin/nginx
with
PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/opt/nginx/sbin/nginx
Then set run levels
sudo update-rc.d nginx defaults
The sudo service nginx start works fine, but the stop command doesn't work. sudo service nginx stop does nothing, nginx jobs are stil there
root 3252 1 0 09:17 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
www-data 3253 3252 0 09:17 ? 00:00:00 nginx: worker process
Note : I didn't uninstall the old 1.2 Nginx installation.
It's really boring and error prone to kill and restart the process after each configuration update ....
Thanks for your help.