[devel] [git update] packages/postgresql8.1: heads/master

Denis Smirnov =?iso-8859-1?q?mithraen_=CE=C1_freesource=2Einfo?=
Вт Мар 20 00:31:48 MSK 2007


Ivan Fedorov пишет:
> Update of /people/ns/packages/postgresql8.1.git

8.0 мой тоже смержи уж. Чтобы дальше не расходиться. Я своих тараканов в 
нем кажется удавил.

> 
> Changes statistics since `8.1.5-alt2.1-1-g201d315' follows:
>  postgresql.init.in |   40 +++++++++++++++++++++-------------------
>  postgresql8.1.spec |    5 ++++-
>  2 files changed, 25 insertions(+), 20 deletions(-)
> 
> Changelog since `8.1.5-alt2.1-1-g201d315' follows:
> commit 4e3e2c5f834ef18fda669186245e036de60bf26e
> Author: Ivan Fedorov <ns на altlinux.org>
> Date:   Mon Mar 19 16:47:31 2007 +0800
> 
>     8.1.8-alt2
>     
>     - merge raorn's changes to initscript
> 
> commit 4c26d8a6d706f16d358cd0013935065ac70bc65a
> Merge: 201d315c2f27586a0d1eb3aea0a27a027c3b7385 5d7854d86d50a54b56722e7712221765ccde3d5a
> Author: Ivan Fedorov <ns на altlinux.org>
> Date:   Mon Mar 19 16:45:17 2007 +0800
> 
>     Merge branch 'alt-raorn-master'
> 
> commit 5d7854d86d50a54b56722e7712221765ccde3d5a
> Author: Sir Raorn <raorn на altlinux.ru>
> Date:   Wed Dec 6 15:54:09 2006 +0300
> 
>     Initscript cleanup.
>     
>     Global:
>      - Quoted all shell variables.
>     
>     delete_wrong_pidfile():
>      - Use readlink instead of cmp when comparing executable name
>     
>     adjust():
>      - Check PG_CHROOT_DIR variable
>     
>     start():
>      - Do not check PG_CHROOT_DIR when trying adjust().
>      - Fix quoting in initdb invocation.
>     
>     stop(), reload():
>      - Use /bin/sh instead ob /bin/bash
>     
>     reload():
>      - Do adjust().
>     
>     Signed-off-by: Alex Gorbachenko (agent_007) <algor на altlinux.ru>
>     Signed-off-by: Sir Raorn <raorn на altlinux.ru>
> 
> Full diff since `8.1.5-alt2.1-1-g201d315' follows:
> diff --git a/postgresql.init.in b/postgresql.init.in
> index 176fab7..ffa43c9 100755
> --- a/postgresql.init.in
> +++ b/postgresql.init.in
> @@ -48,7 +48,7 @@ delete_wrong_pidfile()
>  	fi
>  
>  	# This process not postmaster process
> -	if ! cmp /proc/$PID/exe /usr/bin/postgres; then
> +	if [ "`readlink "/proc/$PID/exe"`" != "/usr/bin/postgres" ]; then
>  	    rm -f "$PIDFILE"
>  	    return
>  	fi
> @@ -58,6 +58,8 @@ delete_wrong_pidfile
>  
>  adjust()
>  {
> +	[ -n "$PG_CHROOT_DIR" ] || return 0
> +
>  	action "Adjusting environment for postgresql:" /etc/chroot.d/postgresql.all
>  	RETVAL=$?
>  	return $RETVAL
> @@ -86,7 +88,7 @@ wait_socket()
>  
>  	local i=0
>  	while [ $i -lt "$w_times" ]; do
> -		filelist=`find_socket $PG_CHROOT_DIR/tmp/.s.PGSQL.*`
> +		filelist=`find_socket "$PG_CHROOT_DIR"/tmp/.s.PGSQL.*`
>  		if [ -n "$filelist" ]; then
>  		    echo $filelist
>  		    return 0
> @@ -99,18 +101,16 @@ wait_socket()
>  
>  start()
>  {
> -	if [ $PG_CHROOT_DIR ]; then
> -	    adjust || return 1
> -	fi
> +	adjust || return 1
>  	
>  	export PGDATA
>  
>  	# Check for the PGDATA structure
> -	if [ -f $PG_CHROOT_DIR$PGDATA/PG_VERSION ] && [ -d $PG_CHROOT_DIR$PGDATA/base ]
> +	if [ -f "$PG_CHROOT_DIR$PGDATA/PG_VERSION" ] && [ -d "$PG_CHROOT_DIR$PGDATA/base" ]
>  	then
>  	# Check version of existing PGDATA
>  
> -		if [ `cat $PG_CHROOT_DIR$PGDATA/PG_VERSION` != '8.1' ];	then
> +		if [ `cat "$PG_CHROOT_DIR$PGDATA/PG_VERSION"` != '8.1' ];	then
>  		    msg_starting postgresql
>  		    failure "Old version. Need to Upgrade. See /usr/share/doc/postgresql-8.1/README.rpm-dist for more information."
>  		    echo
> @@ -119,36 +119,36 @@ start()
>  
>  	# No existing PGDATA! Initdb it.
>  	else
> -                if [ ! -d $PG_CHROOT_DIR$PGDATA ]; then
> -		    mkdir -p $PG_CHROOT_DIR$PGDATA
> -		    chown postgres.postgres $PG_CHROOT_DIR$PGDATA
> +                if [ ! -d "$PG_CHROOT_DIR$PGDATA" ]; then
> +		    mkdir -p "$PG_CHROOT_DIR$PGDATA"
> +		    chown postgres.postgres "$PG_CHROOT_DIR$PGDATA"
>  		fi
>  		# Is expanded this early to be used in the command su runs
> -		echo "export LANG LC_ALL LC_CTYPE LC_COLLATE LC_NUMERIC LC_CTYPE LC_TIME" >> $PG_CHROOT_DIR$PGDATA/../initdb.i18n
> +		echo "export LANG LC_ALL LC_CTYPE LC_COLLATE LC_NUMERIC LC_CTYPE LC_TIME" >> "$PG_CHROOT_DIR$PGDATA/../initdb.i18n"
>  		
> -		action "Creating default database:" /bin/su -s /bin/sh -l postgres -c \'/usr/bin/initdb --pgdata=$PG_CHROOT_DIR$PGDATA\'
> +		action "Creating default database:" /bin/su -s /bin/sh -l postgres -c "/usr/bin/initdb --pgdata=\"$PG_CHROOT_DIR$PGDATA\""
>  		RETVAL=$?
>  		[ "$RETVAL" -ne "0" ] && return $RETVAL;
>  	fi
>  
> -	if [ $PG_CHROOT_DIR ]; then
> +	if [ "$PG_CHROOT_DIR" ]; then
>  	    locale_list=`/bin/su -l postgres -s /bin/sh -c '/usr/bin/locale'`
>  	    export `/bin/echo $locale_list | /usr/bin/tr ' ' "\n" | /bin/grep LANG`
> -	    start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" -- /usr/bin/postmaster -D $PGDATA -S -r $PG_CHROOT_DIR
> +	    start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" -- /usr/bin/postmaster -D "$PGDATA" -S -r "$PG_CHROOT_DIR"
>  	else
> -	    start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --user postgres -- /usr/bin/postmaster -D $PGDATA -S
> +	    start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --user postgres -- /usr/bin/postmaster -D "$PGDATA" -S
>  	fi
>  	
>  	RETVAL=$?
>  	if [ $RETVAL = 0 ]; then
>  		touch "$LOCKFILE"
> -		if [ $PG_CHROOT_DIR ]; then
> +		if [ "$PG_CHROOT_DIR" ]; then
>  			rm -f /tmp/.s.PGSQL.* >/dev/null 2>&1
>  			echo -n "Link postgresql socket: "
>      			socket=`wait_socket 30 1s`
>          		if [ -n "$socket" ]; then
>      		    		for f in $socket; do
> -        			    ln -s $f /tmp/${f##*/} >/dev/null 2>&1
> +        			    ln -s "$f" "/tmp/${f##*/}" >/dev/null 2>&1
>  	        		done
>  				echo_success
>  				echo
> @@ -169,7 +169,7 @@ stop()
>      # pidfile exists -- may be server running
>      if [ -f "$PIDFILE" ]; then
>  	msg_stopping postgresql
> -	if /bin/su -s /bin/bash -c "/usr/bin/pg_ctl -D \"$PGDATA\" stop -mf" postgres 2> /dev/null > /dev/null; then
> +	if /bin/su -s /bin/sh -c "/usr/bin/pg_ctl -D \"$PGDATA\" stop -mf" postgres 2> /dev/null > /dev/null; then
>  		echo_success
>  	    else
>  		echo_failure
> @@ -190,8 +190,10 @@ restart()
>  
>  reload()
>  {
> +	adjust || return 1
> +
>  	msg_reloading postgresql
> -	if /bin/su -s /bin/bash -c "/usr/bin/pg_ctl -D \"$PGDATA\" reload" postgres 2> /dev/null > /dev/null; then
> +	if /bin/su -s /bin/sh -c "/usr/bin/pg_ctl -D \"$PGDATA\" reload" postgres 2> /dev/null > /dev/null; then
>  	    echo_success
>  	else
>  	    echo_failure
> diff --git a/postgresql8.1.spec b/postgresql8.1.spec
> index c8b2d7b..cdf21d1 100644
> --- a/postgresql8.1.spec
> +++ b/postgresql8.1.spec
> @@ -8,7 +8,7 @@
>  %define postgresql_major     8
>  %define postgresql_minor     1
>  %define postgresql_subminor  8
> -%define postgresql_altrel    1
> +%define postgresql_altrel    2
>  %define libpq_major          4
>  %define libpq_minor          1
>  %define libecpg_major        5
> @@ -655,6 +655,9 @@ fi
>  %_libdir/%PGSQL/plpython.so
>  
>  %changelog
> +* Mon Mar 19 2007 Ivan Fedorov <ns на altlinux.ru> 8.1.8-alt2
> +- merge raorn's changes to initscript
> +
>  * Sat Mar 17 2007 Ivan Fedorov <ns на altlinux.ru> 8.1.8-alt1
>  - 8.1.8
>  
> 




Подробная информация о списке рассылки Devel