

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
22 messages in ru.sysoev.nginxRe: Nginx w/ ssh restart| From | Sent On | Attachments |
|---|---|---|
| Victor Iggy | Sep 10, 2008 3:12 pm | |
| Igor Sysoev | Sep 10, 2008 10:09 pm | |
| Victor Iggy | Sep 11, 2008 3:52 pm | |
| Igor Sysoev | Sep 13, 2008 7:06 am | |
| Victor Iggy | Sep 13, 2008 11:18 am | |
| Clint Priest | Sep 14, 2008 5:18 pm | |
| Igor Sysoev | Sep 15, 2008 1:14 am | |
| Victor Iggy | Sep 15, 2008 5:21 pm | |
| Igor Sysoev | Sep 16, 2008 1:42 am | |
| Clint Priest | Sep 16, 2008 9:16 pm | |
| Darrin Chandler | Sep 16, 2008 9:51 pm | |
| Igor Sysoev | Sep 16, 2008 10:34 pm | |
| Mansoor Peerbhoy | Sep 16, 2008 11:17 pm | |
| Igor Sysoev | Sep 16, 2008 11:21 pm | |
| Mansoor Peerbhoy | Sep 16, 2008 11:26 pm | |
| mike | Sep 16, 2008 11:29 pm | |
| Igor Sysoev | Sep 16, 2008 11:41 pm | |
| Igor Sysoev | Sep 16, 2008 11:51 pm | |
| mike | Sep 17, 2008 12:16 am | |
| Clint Priest | Sep 17, 2008 5:28 pm | |
| Samuel Vogel | Sep 17, 2008 5:43 pm | |
| mike | Sep 17, 2008 5:46 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Nginx w/ ssh restart | Actions... |
|---|---|---|
| From: | Igor Sysoev (is...@rambler-co.ru) | |
| Date: | Sep 16, 2008 11:41:56 pm | |
| List: | ru.sysoev.nginx | |
On Tue, Sep 16, 2008 at 11:29:36PM -0700, mike wrote:
On Tue, Sep 16, 2008 at 10:35 PM, Igor Sysoev <is...@rambler-co.ru> wrote:
The problem is probably in "service" utility. What is it ?
redhat style init
i install nginx on redhat using this:
cp /usr/src/build/extras/nginx.initd /etc/init.d/nginx /sbin/chkconfig --add nginx
then 'service' works properly
this is the nginx.initd script:
#!/bin/sh # # Init file for nginx # # chkconfig: 2345 55 25 # description: Nginx web server # # processname: nginx # config: /usr/local/nginx/nginx.conf # pidfile: /usr/local/nginx/nginx.pid
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and # run 'sudo update-rc.d nginx defaults', or use the appropriate command on your # distro. For CentOS/Redhat run: '/sbin/chkconfig --add nginx' # # Author: Ryan Norbauer <ryan...@gmail.com> # Modified: Geoffrey Grosenbach http://topfunky.com # Modified: David Krmpotic http://davidhq.com # Modified: Vishnu Gopal http://vish.in
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="nginx daemon" NAME=nginx DAEMON=/usr/sbin/nginx CONFIGFILE=/etc/nginx/nginx.conf PIDFILE=/var/run/nginx.pid SCRIPTNAME=/etc/init.d/nginx
# Gracefully exit if the package has been removed. test -x $DAEMON || exit 0
d_start() { $DAEMON -c $CONFIGFILE || echo -en "\n already running" }
d_stop() { kill -QUIT `cat $PIDFILE` || echo -en "\n not running" }
d_reload() { kill -HUP `cat $PIDFILE` || echo -en "\n can't reload" }
case "$1" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; reload) echo -n "Reloading $DESC configuration..." d_reload echo "." ;; restart) echo -n "Restarting $DESC: $NAME" d_stop # One second might not be time enough for a daemon to stop, # if this happens, d_start will fail (and dpkg will break if # the package is being upgraded). Change the timeout if needed # be, or change d_stop to have start-stop-daemon use --retry. # Notice that using --retry slows down the shutdown process somewhat. sleep 1 d_start echo "."
BTW, this restart may not work, because -QUIT is a graceful exit, and it may hang for long time, and new nginx will can not bind to listen sockets. It should be changed to somethig like this:
echo -n "Restarting $DESC: $NAME" - d_stop + kill `cat $PIDFILE` || echo -en "\n not running"
;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2 exit 3 ;; esac
exit 0
-- Igor Sysoev http://sysoev.ru/en/







