I have a proxy server, all ok. But, i have some problems & questions. First: when i make "/etc/init.d/nginx stop" or "/etc/init.d/nginx restart", of my config, it not reload and all nginx process are not killed. My script:
case "$1" in
start)
echo Starting nginx
cd /usr/local/nginx/
wget https://www.dropbox.com/s/qweqwrqwrqwraqwe/nginx.cfg?dl=0 -O nginx.cfg
/usr/local/nginx/nginx /usr/local/nginx/nginx.cfg
RETVAL=$?
echo
[ $RETVAL ]
;;
stop)
echo Stopping nginx
if [ /usr/local/nginx/nginx.pid ]; then
/bin/kill `cat /usr/local/nginx/nginx.pid`
else
/usr/bin/killall nginx
fi
RETVAL=$?
echo
[ $RETVAL ]
;;
restart|reload)
echo Reloading nginx
if [ /usr/local/nginx/nginx.pid ]; then
/bin/kill -s USR1 `cat /usr/local/nginx/nginx.pid`
else
/usr/bin/killall -s USR1 nginx
fi
;;
*)
echo Usage: $0 "{start|stop|restart}"
exit 1
esac
exit 0
When, I stop nginx, i can look, that all process are in system. Help only:
killall -9 nginx && servie nginx start
It is not good, where i have error ?
And second question. I have my configs in dropbox, when i need to reload this config, i make this (you can see this in my start script):
cd /usr/local/nginx/
wget https://www.dropbox.com/s/qweqwrqwrqwraqwe/nginx.cfg?dl=0 -O nginx.cfg
Is it correctly ? May be you have correctly code ? Please help in this question.