yum update minor version | /sbin/service postgresql-11 condstopquestion - Mailing list pgsql-pkg-yum

From Jason Ralph
Subject yum update minor version | /sbin/service postgresql-11 condstopquestion
Date
Msg-id BL0PR04MB6499D500252544FDCF4B336CD0710@BL0PR04MB6499.namprd04.prod.outlook.com
Whole thread Raw
Responses Re: yum update minor version | /sbin/service postgresql-11 condstopquestion  (Devrim Gündüz <devrim@gunduz.org>)
List 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@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@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,
Iam 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
versionof 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
liketo 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
withoutstopping the database? Please forgive my ignorance here, and help me understand what happens when you yum update
toa 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@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
addresseeyou should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if
youhave received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be
guaranteedto 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
contentsof this message, which arise as a result of e-mail transmission. If verification is required please request a
hard-copyversion. 



pgsql-pkg-yum by date:

Previous
From: Helmut Rickel
Date:
Subject: Wanted: PostgreSQL 12 on SLES 12
Next
From: Justin Pryzby
Date:
Subject: pg_repack12