Bug 630110

Summary: Drop openais init script all together
Product: Red Hat Enterprise Linux 6 Reporter: Steven Dake <sdake>
Component: openaisAssignee: Fabio Massimo Di Nitto <fdinitto>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: cluster-maint, fdinitto, jkortus, jturner, ssaha, uwe.knop
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openais-1.1.1-7.el6 Doc Type: Bug Fix
Doc Text:
Previous versions of the openais packages included the /etc/rc.d/init.d/openais init script with the stop priority set to "20". Consequent to this, shutting down a system caused this init script to stop the openais service in a wrong order. Since this init script is not needed, this update removes /etc/rc.d/init.d/openais from the packages, and the openais service is now stopped when expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 14:19:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Change chkconfig shutdown priority from 20 to 80.
none
Change chkconfig shutdown priority from 20 to 80.
none
proposed patch none

Description Steven Dake 2010-09-03 17:57:57 UTC
Description of problem:
openais init script is chkconfig 20/20

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. stop openais via system shutdown
2.
3.
  
Actual results:
openais will shutdown in wrong order violating symmetry of init scripts

Expected results:
openais should follow symmetry guidelines of init scripts

Additional info:

Comment 2 Ryan O'Hara 2010-09-03 19:18:02 UTC
Created attachment 442961 [details]
Change chkconfig shutdown priority from 20 to 80.

Comment 3 Ryan O'Hara 2010-09-07 15:11:16 UTC
Created attachment 443536 [details]
Change chkconfig shutdown priority from 20 to 80.

Here is an updated patch that also defines that this init script "provides" corosync, as suggested.

Comment 15 Steven Dake 2010-12-06 21:19:00 UTC
Fabio,

Ryan's plan here is to remove the openais init script from the rpm and change the rpm spec file as follows:
cvs diff: Diffing .
Index: openais.spec
===================================================================
RCS file: /cvs/dist/rpms/openais/RHEL-6/openais.spec,v
retrieving revision 1.31
diff -r1.31 openais.spec
83,94d82
< %post
< /sbin/chkconfig --add openais || :
< 
< %preun
< if [ $1 -eq 0 ]; then
<     %{_initrddir}/openais stop &>/dev/null || :
<     /sbin/chkconfig --del openais || :
< fi
< 
< %postun
< [ "$1" -ge "1" ] && %{_initrddir}/openais condrestart &>/dev/null || :
< 
100d87
< %{_initrddir}/openais


can you please advise if this will work properly because of the postun functionality?

Comment 16 Ryan O'Hara 2010-12-06 21:25:26 UTC
If I understand correctly, corosync will be restarted after openais rpm is upgraded. Is that right? Is that what we want? Or can we remove the postun?

What we do with postun will determine if we can remove the openais init script or not. I'll wait to get Fabio's input.

Comment 17 Fabio Massimo Di Nitto 2010-12-07 02:40:51 UTC
(In reply to comment #15)
> Fabio,
> 
> Ryan's plan here is to remove the openais init script from the rpm and change
> the rpm spec file as follows:
> cvs diff: Diffing .
> Index: openais.spec
> ===================================================================
> RCS file: /cvs/dist/rpms/openais/RHEL-6/openais.spec,v
> retrieving revision 1.31
> diff -r1.31 openais.spec
> 83,94d82
> < %post
> < /sbin/chkconfig --add openais || :
> < 
> < %preun
> < if [ $1 -eq 0 ]; then
> <     %{_initrddir}/openais stop &>/dev/null || :
> <     /sbin/chkconfig --del openais || :
> < fi
> < 
> < %postun
> < [ "$1" -ge "1" ] && %{_initrddir}/openais condrestart &>/dev/null || :
> < 
> 100d87
> < %{_initrddir}/openais
> 
> 
> can you please advise if this will work properly because of the postun
> functionality?

I don't think this is a problem. IIRC we dropped the %postun section all together in corosync because it was creating an upgrade loop/issue.
It's possible we forgot to drop it from openais.

Comment 18 Fabio Massimo Di Nitto 2010-12-07 02:43:15 UTC
(In reply to comment #16)
> If I understand correctly, corosync will be restarted after openais rpm is
> upgraded. Is that right? Is that what we want? Or can we remove the postun?
> 
> What we do with postun will determine if we can remove the openais init script
> or not. I'll wait to get Fabio's input.

The cluster package update path doesn't allow the cluster software to run during upgrades. This is documented somewhere in a kbase.

There are too many issues to keep it running during an upgrade.

The general agreement was also not to attempt any restart at any time (as it was source of different other problems).

So you are safe to drop the postun section. This should probably have happened together with the corosync change.

Comment 19 Jay Turner 2010-12-07 13:39:13 UTC
So we are to:
1) Remove the openais initscript from the shipping packages.
2) Remove the %post, %preun and %postun from the shipping openais packages.
3) Test package upgrades of both corosync and openais.

Something to note with regards to this testing, the %preun and %postun sections from the "old" openais will still execute so there is a potential for something weird to happen after the initscript disappears.  In addition, should think about whether it is necessary to take some action on the dangling openais initscript (whcih was laid down by the old package.)  Probably will be necessary to 'chkconfig -del openais' or something of that sort.

Comment 20 Ryan O'Hara 2010-12-07 16:01:41 UTC
(In reply to comment #19)
> So we are to:
> 1) Remove the openais initscript from the shipping packages.
> 2) Remove the %post, %preun and %postun from the shipping openais packages.
> 3) Test package upgrades of both corosync and openais.
> 
> Something to note with regards to this testing, the %preun and %postun sections
> from the "old" openais will still execute so there is a potential for something
> weird to happen after the initscript disappears.  In addition, should think
> about whether it is necessary to take some action on the dangling openais
> initscript (whcih was laid down by the old package.)  Probably will be
> necessary to 'chkconfig -del openais' or something of that sort.

chkconfig -del openais is one option. Could we just remove the script altogether (ie. rm -f)?

Comment 21 Jay Turner 2010-12-07 18:59:15 UTC
Those comments were intended to be two separate thoughts.  Need to remove the old initscript (/etc/rc.d/init.d/openais) but also need to remove the start and stop symlinks from the /etc/rc.d/rc[0-6].d/ directories (which is what 'chkconfig -del' will do for you.)

Comment 22 Jay Turner 2010-12-16 15:10:57 UTC
Still need details about the actual changes which are being made so that QE can develop a corresponding test plan.

Comment 24 Fabio Massimo Di Nitto 2011-01-11 12:41:40 UTC
Created attachment 472801 [details]
proposed patch

The patch in attachment allows to drop openais init script completely and in a nice way.

Tested with some extra debugging output:

Install openais (taken from distcvs):

Installed:
  openais.x86_64 0:1.1.1-6.el6          openaislib.x86_64 0:1.1.1-6.el6         

Complete!

[root@rhel6-node2 rc.d]# find . -name "*openais*"
./rc5.d/S20openais
./rc3.d/S20openais
./rc4.d/S20openais
./init.d/openais
./rc2.d/S20openais
./rc6.d/K20openais
./rc1.d/K20openais
./rc0.d/K20openais

Apply patch and upgrade:
[root@rhel6-node2 packages]# rpm -U openais-1.1.1-7.el6_0.x86_64.rpm openaislib-1.1.1-7.el6_0.x86_64.rpm 
Disabling openais init

^^^^ at this point /etc/rc.d/init.d/openais is gone as well as all the symlinks in the different runlevels.

[root@rhel6-node2 packages]# rpm -U openais-1.1.1-8.el6_0.x86_64.rpm openaislib-1.1.1-8.el6_0.x86_64.rpm 
did not trigger the pre

^^^ simulated upgrade to the next version that does not trigger the removal code.

(the output was stripped from the final patch as it was only useful for debugging).

[root@rhel6-node2 rc.d]# pwd
/etc/rc.d
[root@rhel6-node2 rc.d]# find . -name "*openais*"
[root@rhel6-node2 rc.d]# 

We generally do not support upgrade of cluster packages while cluster is running, but in the corner case situation where openais was running, it will be possible to execute a "/etc/rc.d/init.d/corosync stop" to obtain the same behavior.

The user will be left with no direct way to load openais services in corosync unless explicitly enabled in corosync.conf from this moment on.

Comment 32 Jaromir Hradilek 2011-04-15 16:23:10 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previous versions of the openais packages included the /etc/rc.d/init.d/openais init script with the stop priority set to "20". Consequent to this, shutting down a system caused this init script to stop the openais service in a wrong order. Since this init script is not needed, this update removes /etc/rc.d/init.d/openais from the packages, and the openais service is now stopped when expected.

Comment 34 errata-xmlrpc 2011-05-19 14:19:56 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0740.html