yum update minor version | /sbin/service postgresql-11 condstop question

From: Jason Ralph <jralph(at)affinitysolutions(dot)com>
To: "pgsql-pkg-yum(at)lists(dot)postgresql(dot)org" <pgsql-pkg-yum(at)lists(dot)postgresql(dot)org>
Subject: yum update minor version | /sbin/service postgresql-11 condstop question
Date: 2019-11-14 16:06:48
Message-ID: BL0PR04MB6499D500252544FDCF4B336CD0710@BL0PR04MB6499.namprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

Hello List,
I have a couple of questions that I am hoping someone can shed some light on, I am learning how rpms work. thank you all!!!
[root(at)jr-sandbox ~]# uname -a
Linux jr-sandbox 2.6.32-754.23.1.el6.x86_64 #1 SMP Thu Sep 26 12:05:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root(at)jr-sandbox ~]# cat /etc/redhat-release
CentOS release 6.10 (Final)

postgres=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23), 64-bit
(1 row)

I am trying to understand what happens when you yum update postgresql11-server, I have taken a look at the rpm scripts, I am very new to RPM package details so bear with me.
I no longer see a condstop function in the /etc/init.d/postgresql-11 init script, so if you are trying remove last version of the package, which I think happens first when updating, not sure this would work, please help me understand this?

if [ $1 -eq 0 ] ; then
/sbin/service postgresql-11 condstop >/dev/null 2>&1
chkconfig --del postgresql-11

fi

My ultimate goal here is to find out what happens when you yum update a minor version of postgresql11-server, I would like to know if postgresql11-server will stop, or do I need to manually do this? I see the following block under postuninstall, so is this after the packages are removed it restarts the service? Will it remove the previous packages without stopping the database? Please forgive my ignorance here, and help me understand what happens when you yum update to a minor version. Thank you for the great effort on this awesome piece of software.

postuninstall scriptlet (using /bin/sh):
/sbin/ldconfig
/sbin/service postgresql-11 condrestart >/dev/null 2>&1
if [ $1 -ge 1 ] ; then
/sbin/service postgresql-11 condrestart >/dev/null 2>&1
fi

[root(at)devdbadmin 6]# rpm -qp --scripts postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm
warning: postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
preinstall scriptlet (using /bin/sh):
groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
useradd -M -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
-c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
postinstall scriptlet (using /bin/sh):
/sbin/ldconfig
if [ $1 -eq 1 ] ; then
chkconfig --add postgresql-11
fi

# postgres' .bash_profile.
# We now don't install .bash_profile as we used to in pre 9.0. Instead, use cat,
# so that package manager will be happy during upgrade to new major version.
echo "[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/pgsql/11/data
export PGDATA
# If you want to customize your settings,
# Use the file below. This is not overridden
# by the RPMS.
[ -f /var/lib/pgsql/.pgsql_profile ] && source /var/lib/pgsql/.pgsql_profile" > /var/lib/pgsql/.bash_profile
chown postgres: /var/lib/pgsql/.bash_profile
chmod 700 /var/lib/pgsql/.bash_profile
preuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ] ; then
/sbin/service postgresql-11 condstop >/dev/null 2>&1
chkconfig --del postgresql-11

fi
postuninstall scriptlet (using /bin/sh):
/sbin/ldconfig
/sbin/service postgresql-11 condrestart >/dev/null 2>&1
if [ $1 -ge 1 ] ; then
/sbin/service postgresql-11 condrestart >/dev/null 2>&1
fi

# Create alternatives entries for common binaries and man files

Jason Ralph

This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

Responses

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Justin Pryzby 2019-11-15 16:01:09 pg_repack12
Previous Message Helmut Rickel 2019-11-13 12:04:24 Wanted: PostgreSQL 12 on SLES 12