ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] [git update] packages/nginx: heads/master
Date: Fri, 31 Aug 2007 01:24:22 +0400
Message-ID: <20070830212422.GA21110@basalt.office.altlinux.org> (raw)
In-Reply-To: <20070830211520.1828B1CB46A4@ssh.git.local.altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 2289 bytes --]

On Fri, Aug 31, 2007 at 01:15:18AM +0400, Denis Smirnov wrote:
> Update of /people/mithraen/packages/nginx.git
[...]
> Full diff since `nginx/0.5.31-alt2' follows:
> diff --git a/nginx.init b/nginx.init
> index 342181a..290bf4e 100755
> --- a/nginx.init
> +++ b/nginx.init
> @@ -13,6 +13,8 @@ WITHOUT_RC_COMPAT=1
>  
>  LOCKFILE=/var/lock/nginx/nginx
>  PIDFILE=/var/run/nginx.pid
> +OLDBINPID=/var/run/nginx.pid.oldbin
> +BINARY=/usr/sbin/nginx

Зачем это??
>  RETVAL=0
>  
>  start()
> @@ -26,7 +28,7 @@ start()
>  
>  stop()
>  {
> -	stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root --name nginx -- /usr/sbin/nginx
> +	stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root --name nginx -- $BINARY

Не нужен никакой $BINARY, выкиньте --name nginx и напишите по-человечески.
Может хотя бы /etc/init.d/template посмотрите?

>  upgrade()
>  {
> -    check
> -    RETVAL=$?
> -    if [ $RETVAL -eq 0 ]; then
> -    	echo -n $"Upgrading nginx: "
> -    	kill -USR2 `cat $PIDFILE`
> +	conftest
>  	RETVAL=$?
> +	echo -n "Upgrading nginx: "
> +	if [ $RETVAL -eq 0 ]; then
> +		# TODO: use start-stop-daemon?
> +		[ -s "$PIDFILE" ] && kill -USR2 `cat "$PIDFILE"`
> +		RETVAL=$?
> +		# let the signal through; the system might be fairly busy,
> +		# so if we don't see the oldpidfile immediately, wait 5 sec
> +		[ -s "$OLDBINPID" ] || sleep 5
> +		[ -s "$OLDBINPID" ] && kill -TERM `cat "$OLDBINPID"`
> +		success
> +	else 
> +		failure
> +		RETVAL=1
> +	fi

Какому пользователю принадлежит файл $PIDFILE?
Делать
kill -USR2 `cat "$PIDFILE"`
не глядя нельзя, если слово "безопасность" для вас не пустой звук.

>  	condrestart)
> -		[ -e "$LOCKFILE" ] && upgrade ||: 
> +		# package upgrade should invoke upgrade();
> +		# sysadmin doing condrestart by hand
> +		# should invoke restart() if nginx's running.
> +		# see also manual/triggers in rpm docs
> +		# and /usr/sbin/post_service
> +		if ! [ "$RPM_INSTALL_ARG1" -ge 0 ] 2>/dev/null; then
> +			if [ -e "$LOCKFILE" ]; then
> +				restart
> +			fi
> +			exit 0
> +		fi
> +		if [ "$RPM_INSTALL_ARG1" -gt 1 ]; then
> +			upgrade
> +		fi

А почему при обновлении пакета нельзя выполнить обычный condrestart?


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

       reply	other threads:[~2007-08-30 21:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 21:24 ` Dmitry V. Levin [this message]
2007-08-30 22:27   ` Konstantin A. Lepikhov
2007-08-31  0:09     ` Dmitry V. Levin
2007-08-31  0:32       ` Michael Shigorin
2007-08-31  0:40         ` Dmitry V. Levin
2007-08-31  0:47           ` Michael Shigorin
2007-08-31  1:10             ` Dmitry V. Levin
2007-08-31 14:02               ` Michael Shigorin
2007-08-31 21:43                 ` Dmitry V. Levin
2007-08-31 14:11   ` Michael Shigorin
2007-08-31 15:19     ` Денис Смирнов
2007-08-31 15:56       ` [devel] [git update] [JT] " Alexey I. Froloff
2007-09-01 13:09         ` Денис Смирнов

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070830212422.GA21110@basalt.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git