Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enBZy-0002aq-Hu for pgsql-general@arkaria.postgresql.org; Sat, 17 Feb 2018 23:07:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enBZx-0005wJ-Ha for pgsql-general@arkaria.postgresql.org; Sat, 17 Feb 2018 23:07:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1enBZw-0005w9-Nm for pgsql-general@lists.postgresql.org; Sat, 17 Feb 2018 23:07:37 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enBZs-0001Zf-7E for pgsql-general@postgresql.org; Sat, 17 Feb 2018 23:07:35 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 058C920AA5; Sat, 17 Feb 2018 18:07:31 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Sat, 17 Feb 2018 18:07:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=pGKBxXQC10xBLg+8qJzKNGeFFtkaG jqmtq6lW29cBZw=; b=EX90hC/zjICBzwqSuqBblZh3hyy5noL0Xe7rcpE83U1td geW41die56RF170NzUDTpnNXBXdpP8/LNKn7D7Ba7dofLEiUfFjP0QAld+NmkRch 0DZTrzDocSPFCYUwnb6p8AaWLdjzhxPKZR5CpA+J0mAn5DVBjVTjodGkQuOenwkr gBbsmiS/Z6cp7FbnJnBzxrmzx5hycLI5Qdx57OcAbDHBbtSUi4SDGz5o4wqt8D6y Uqo5tw9v+ROZJ3m1h3ndMcJjC5D21dQrPxfhl2BotURgti8TcFBANGsygWzWizxt 6yL3YR/WNyGuGoyn7HdLczzUvzE4Uk6UIVe1yaong== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=pGKBxX QC10xBLg+8qJzKNGeFFtkaGjqmtq6lW29cBZw=; b=W9vzxGm/w14AIs45qtALpt 3CBa/MMfZHPYYUEVTvGTtwIe0PoK31W2wSJv23jntb23rAYot84U80ZCqu/NC5lf RRjg5kG9aanWqNRd/0Kmtq7PnlS5GZbtDdE4KYdTHUCU/5zGjz2oYFHOXKQHhDBm nR8PmOPaE/E/DlXantc8LmgCthRXL/Euh9em8uVlPn//M2lBWIA33KtoKxeFVlYB SWnNzpxDqOA0+aNv/ISEH+l5vYLcdc1blsGXPiMKUZ07LGvjC/E0r+2uqwcx5eD8 l2UOrVnSRkIHgm3JN/FrNsj0b7bMiICh/nuuKSo0whkHGDJpBKblRCn7xxaCvSCg == X-ME-Sender: Received: from [192.168.1.3] (71-212-36-41.tukw.qwest.net [71.212.36.41]) by mail.messagingengine.com (Postfix) with ESMTPA id 7745D2469C; Sat, 17 Feb 2018 18:07:30 -0500 (EST) Subject: Re: Need to fix one more glitch in upgrade to -10.2 To: Rich Shepard , pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: Date: Sat, 17 Feb 2018 15:07:29 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 02/17/2018 02:25 PM, Rich Shepard wrote: > On Sat, 17 Feb 2018, Adrian Klaver wrote: > >> How did you upgrade, dump/restore or pg_upgrade? > > Adrian, > >   Ran 'pg_dumpall -c -f .sql' prior to doing anything. Then > built, > installed the new version, upgraded rc.postgresql (only differences were > version numbers), and ran 'pg_upgrade ...' with the appropriate binary and > data directory paths. Did pg_upgrade spit out any warnings/errors? > >> What is in rc.postgresql? Is there maybe another start script in etc/ for >> the new version? In your previous post you showed: # /etc/rc.postgresql reload yet below shows: /etc/rc.d/rc.postgresql Cut and paste error or not? So are env variables set correctly? Your ps ax output showed a Postgres instance running: postgres -D /var/lib/pgsql/10.2/data Do you know what port it is using and try to connect to it? > >   Nope. One script per application. > > /etc/rc.d/rc.postgresql: > > #!/bin/bash > > # PostgreSQL startup script for Slackware Linux > # > # $Revision$ > # $Date$ > # > # Copyright 2007-2018 Adis Nezirovic > # All rights reserved. > # > # Redistribution and use of this script, with or without modification, is > # permitted provided that the following conditions are met: > # > # 1. Redistributions of this script must retain the above copyright > #    notice, this list of conditions and the following disclaimer. > # > #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR > IMPLIED > #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF > #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > IN NO > #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > LIMITED TO, > #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR > PROFITS; > #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > # Do not source this script (since it contains exit() calls) > # > # Since version 9.3 this startup script can run multiple PostgreSQL > # versions on different ports and with different data dirs. > # # e.g. PG_VERSION=10.2 PG_PORT=6432 /etc/rc.d/rc.@PRGNAM@ start > > PG_VERSION=${PG_VERSION:-@PG_VERSION@} > PG_PORT=${PG_PORT:-@PG_PORT@} > LIBDIRSUFFIX="@LIBDIRSUFFIX@" > LOGFILE=/var/log/@PRGNAM@-$PG_VERSION > DATADIR=/var/lib/pgsql/$PG_VERSION/data > POSTGRES=/usr/lib${LIBDIRSUFFIX}/@PRGNAM@/$PG_VERSION/bin/postgres > PG_CTL=/usr/lib${LIBDIRSUFFIX}/@PRGNAM@/$PG_VERSION/bin/pg_ctl > PIDFILE=$DATADIR/postmaster.pid > > # oom-killer score > # > # > http://www.postgresql.org/docs/10.2/static/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT > > PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj > PG_MASTER_OOM_SCORE_ADJ=-1000 > PG_CHILD_OOM_SCORE_ADJ=0 > PG_ENV="PG_OOM_ADJUST_FILE=$PG_OOM_ADJUST_FILE > PG_OOM_ADJUST_VALUE=$PG_CHILD_OOM_SCORE_ADJ" > > # Return values (according to LSB): > # 0 - success > # 1 - generic or unspecified error > # 2 - invalid or excess argument(s) > # 3 - unimplemented feature (e.g. "reload") > # 4 - insufficient privilege > # 5 - program is not installed > # 6 - program is not configured > # 7 - program is not running > > pg_ctl() > { >     CMD="$PG_CTL -o '-p $PG_PORT' $@" >     su - postgres -c "$PG_ENV $CMD" > } > > if [ ! -f $POSTGRES ]; then >     echo "Could not find 'postgres' binary. Maybe PostgreSQL is not > installed properly?" >     exit 5 > fi > > case "$1" in > >     "start") >         echo "Starting PostgreSQL" >         touch $LOGFILE >         chown postgres:wheel $LOGFILE >         chmod 0640 $LOGFILE > >         if [ ! -e $DATADIR/PG_VERSION ]; then >             echo "You should initialize the PostgreSQL database at > location $DATADIR" >             echo "e.g. su postgres -c \"initdb -D $DATADIR > --locale=en_US.UTF-8 -A md5 -W\"" >             exit 6 >         fi > >         if [ $(pgrep -f $POSTGRES) ]; then > >             echo "PostgreSQL daemon already running" >             if [ ! -f $PIDFILE ]; then >                 echo "Warning: Missing pid file $PIDFILE" >             fi >             exit 1 > >         else >             test -e "$PG_OOM_ADJUST_FILE" && echo > "$PG_MASTER_OOM_SCORE_ADJ" > "$PG_OOM_ADJUST_FILE" >             pg_ctl start -w -l $LOGFILE -D $DATADIR >             exit 0 >         fi >     ;; > >     "stop") >         echo "Shutting down PostgreSQL..." >         pg_ctl stop -l $LOGFILE -D $DATADIR -m smart >     ;; > >     "force-stop") >         # Take care! This will kill _all_ client connections >         # and rollback current transactions. >         echo "Shutting down PostgreSQL (fast)..." >         pg_ctl stop -l $LOGFILE -D $DATADIR -m fast >     ;; > >     "unclean-stop") >         # Take care! This will abort server process itself >         # resulting with database recovery on next start. >         echo "Shutting down PostgreSQL (immediate)..." >         pg_ctl stop -l $LOGFILE -D $DATADIR -m immediate >     ;; > >     "restart") >         echo "Restarting PostgreSQL..." >         test -e "$PG_OOM_ADJUST_FILE" && echo > "$PG_MASTER_OOM_SCORE_ADJ" > "$PG_OOM_ADJUST_FILE" >         pg_ctl restart -l $LOGFILE -D $DATADIR -m smart >     ;; > >     "force-restart") >         # Take care! This will kill _all_ client connections >         # and rollback current transactions. >         echo "Restarting PostgreSQL (fast)..." >         pg_ctl restart -l $LOGFILE -D $DATADIR -m fast >     ;; > >     "unclean-restart") >         # Take care: This will abort server process itself >         # resulting with database recovery on start. >         echo "Restarting PostgreSQL (immediate)..." >         pg_ctl restart -l $LOGFILE -D $DATADIR -m immediate >     ;; > >     "reload") >         echo "Reloading configuration for PostgreSQL..." >         pg_ctl reload -l $LOGFILE -D $DATADIR -m smart >     ;; > >     "status") >         if [ $(pgrep -f $POSTGRES) ]; then >             echo "PostgreSQL is running" > >             if [ ! -e $PIDFILE ]; then >                 echo "Warning: Missing pid file $PIDFILE" >             fi > >             exit 0 >         else >             echo "PostgreSQL is stopped" > >             if [ -e $PIDFILE ]; then >                 echo "Detected stale pid file $PIDFILE" >             fi > >             exit 0 >         fi >     ;; > >     *) >         # unclean-stop and unclean-restart are not documented on purpose. >         echo "Usage: $0 > {start|stop|force-stop|status|restart|force-restart|reload}" >         exit 1 >     ;; > esac > > Regards, > > Rich > > -- Adrian Klaver adrian.klaver@aklaver.com