Bug 1078829
| Summary: | Automatic condrestart upon package upgrade breaks exports from Veritas cluster | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Oliver Falk <oliver> | |
| Component: | nfs-utils | Assignee: | Steve Dickson <steved> | |
| Status: | CLOSED ERRATA | QA Contact: | Yongcheng Yang <yoyang> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 6.5 | CC: | eguan, fs-qe, jentrena, jiyin, pdwyer, steved | |
| Target Milestone: | rc | Keywords: | Reopened | |
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | nfs-utils-1.2.3-58.el6 | Doc Type: | Bug Fix | |
| Doc Text: |
Not needed because
a customer was never affected by the issue
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1200713 (view as bug list) | Environment: | ||
| Last Closed: | 2015-07-22 06:49:53 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1075802, 1200713 | |||
|
Description
Oliver Falk
2014-03-20 11:19:49 UTC
The postuninstall script of the nfs-utils package calls a condrestart on the nfs service, even for an upgrade ( "$1" -ge 1 in postuninstall ): http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax # rpm -q --scripts nfs-utils | grep -A100 postuninstall postuninstall scriptlet (using /bin/sh): if [ "$1" -ge 1 ]; then /etc/rc.d/init.d/rpcgssd condrestart > /dev/null /etc/rc.d/init.d/nfs condrestart > /dev/null /etc/rc.d/init.d/nfslock condrestart > /dev/null fi /etc/init.d/nfs service will issue a stop order to itself: condrestart | try-restart) [ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condrestart [ -f /var/lock/subsys/nfs ] && { $0 stop $0 start RETVAL=$? } ;; /etc/init.d/nfs will execute exportfs -au causing all current exports to be deleted from /var/lib/nfs/etab: stop) [...] # Do it the last so that clients can still access the server # when the server is running. cnt=`/usr/sbin/exportfs -v | /usr/bin/wc -l` if [ $cnt -gt 0 ]; then action $"Shutting down NFS services: " /usr/sbin/exportfs -au rval=$? [ $RETVAL -eq 0 ] && RETVAL=$rval fi Hey! Thanks for the KB article and touching this BR, however, this doesn't solve the issue. Is there no option to save the exports first and afterwards recreate them? At least automatically reconnecting nfs client (that should be anyway the case for all...) wouldn't suffer any longer. Best, Oliver (In reply to Oliver Falk from comment #3) > Thanks for the KB article and touching this BR, however, this doesn't solve > the issue. Is there no option to save the exports first and afterwards > recreate them? At least automatically reconnecting nfs client (that should > be anyway the case for all...) wouldn't suffer any longer. I'm thinking this is more of a Veritas cluster problem than an Red Hat nfs-utils problem. Squirrelling exports away before the update is dangerous because we could restore old exports upon new exports if the exports changed during the upgrade. So I'm going to close this bz out as NOTABUG. Please feel free to reopen the bz if I'm missing something. Hi Steve, Thanks for that. As per comment 2 the main reason for NFS exports not defined in file /etc/exports are not preserved during the update of 'nfs-utils' package is that the postinstall script runs a "nfs condrestart" which in turn runs a "exportfs -au" thus wiping contents of /var/lib/nfs/etab . In systems where a 3rd party cluster stack is managing those exports, current behaviour prevents customers from deploying updates to their systems and scheduling a reboot at a later time, since the NFS exports break during the package upgrade. Could we, at least, make the current behaviour of restarting NFS daemons optional in a similar way as we did for 'httpd' in bug 833042 , by checking for the existence of a file in e.g. /etc/sysconfig/nfs-utils-disable-posttrans and refraining from restarting NFS daemons only if such file exists? That would not break current behaviour and would give customers impacted by this the possibility of updating systems and rebooting systems at different times. (In reply to Julio Entrena Perez from comment #5) > Could we, at least, make the current behaviour of restarting NFS daemons > optional in a similar way as we did for 'httpd' in bug 833042 , by checking > for the existence of a file in e.g. > /etc/sysconfig/nfs-utils-disable-posttrans and refraining from restarting > NFS daemons only if such file exists? > > That would not break current behaviour and would give customers impacted by > this the possibility of updating systems and rebooting systems at different > times. Go ahead and post a patch to the current sysinit script to make that happen... How is this going to work in RHEL7? (In reply to Steve Dickson from comment #6) > Go ahead and post a patch to the current sysinit script to make that > happen... The change would be in the postuninstall script rather than in the initscript. Currently: postuninstall scriptlet (using /bin/sh): if [ "$1" -ge 1 ]; then if [ -f /etc/rc.d/init.d/rpcgssd ]; then /etc/rc.d/init.d/rpcgssd condrestart > /dev/null fi if [ -f /etc/rc.d/init.d/nfs ]; then /etc/rc.d/init.d/nfs condrestart > /dev/null fi if [ -f /etc/rc.d/init.d/nfslock ]; then /etc/rc.d/init.d/nfslock condrestart > /dev/null fi fi Proposed (moving the restart from postuninstall to posttrans): posttrans scriptlet (using /bin/sh): if [ ! -f /etc/sysconfig/nfs-utils-disable-posttrans ]; then if [ -f /etc/rc.d/init.d/rpcgssd ]; then /etc/rc.d/init.d/rpcgssd condrestart > /dev/null fi if [ -f /etc/rc.d/init.d/nfs ]; then /etc/rc.d/init.d/nfs condrestart > /dev/null fi if [ -f /etc/rc.d/init.d/nfslock ]; then /etc/rc.d/init.d/nfslock condrestart > /dev/null fi fi That should preserve the current behaviour of restarting the daemons by default unless user touches file /etc/sysconfig/nfs-utils-disable-posttrans to prevent it. > How is this going to work in RHEL7? The same way. For example looking at RHEL7's httpd: - postuninstall just reloads the systemd unit file for httpd - only if file /etc/sysconfig/httpd-disable-posttrans does not exist then we restart httpd daemon """ postuninstall scriptlet (using /bin/sh): /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : # Trigger for conversion from SysV, per guidelines at: # https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd posttrans scriptlet (using /bin/sh): test -f /etc/sysconfig/httpd-disable-posttrans || \ /bin/systemctl try-restart httpd.service htcacheclean.service >/dev/null 2>&1 || : """ Hi! Steve, you said it's a Veritas problem and yes, indeed, it is, but it's a problem Veritas cannot solve, since it has no influence on the behaviour. Saving and restoring the exports was only an idea - since the upgrade of the nfs package doesn't take ages, but only a few seconds, I thought it's save to do it that way... Anyway. What Julio suggested, to do it the same way as with httpd, I'm fine with that as well. Again, thanks for taking care of this BZ! (In reply to Julio Entrena Perez from comment #7) > (In reply to Steve Dickson from comment #6) > > Go ahead and post a patch to the current sysinit script to make that > > happen... > > The change would be in the postuninstall script rather than in the > initscript. > > Currently: > > postuninstall scriptlet (using /bin/sh): > if [ "$1" -ge 1 ]; then > if [ -f /etc/rc.d/init.d/rpcgssd ]; then > /etc/rc.d/init.d/rpcgssd condrestart > /dev/null > fi > if [ -f /etc/rc.d/init.d/nfs ]; then > /etc/rc.d/init.d/nfs condrestart > /dev/null > fi > if [ -f /etc/rc.d/init.d/nfslock ]; then > /etc/rc.d/init.d/nfslock condrestart > /dev/null > fi > fi > > Proposed (moving the restart from postuninstall to posttrans): > > posttrans scriptlet (using /bin/sh): > > if [ ! -f /etc/sysconfig/nfs-utils-disable-posttrans ]; then Why remove the if [ "$1" -ge 1 ]; then clause? > if [ -f /etc/rc.d/init.d/rpcgssd ]; then > /etc/rc.d/init.d/rpcgssd condrestart > /dev/null > fi > if [ -f /etc/rc.d/init.d/nfs ]; then > /etc/rc.d/init.d/nfs condrestart > /dev/null > fi > if [ -f /etc/rc.d/init.d/nfslock ]; then > /etc/rc.d/init.d/nfslock condrestart > /dev/null > fi > fi > > That should preserve the current behaviour of restarting the daemons by > default unless user touches file /etc/sysconfig/nfs-utils-disable-posttrans > to prevent it. > > > How is this going to work in RHEL7 > > The same way. For example looking at RHEL7's httpd: > > - postuninstall just reloads the systemd unit file for httpd > - only if file /etc/sysconfig/httpd-disable-posttrans does not exist then we > restart httpd daemon > > """ > postuninstall scriptlet (using /bin/sh): > > /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : > > > # Trigger for conversion from SysV, per guidelines at: > # https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd > posttrans scriptlet (using /bin/sh): > test -f /etc/sysconfig/httpd-disable-posttrans || \ > /bin/systemctl try-restart httpd.service htcacheclean.service >/dev/null > 2>&1 || : > """ Please open up another RHEL7 bz with this info in it. Shall I open the BZ for RHEL7 or is anyone else willing to do? :-) (In reply to Steve Dickson from comment #9) > Why remove the if [ "$1" -ge 1 ]; then clause? $1 is always 0 in posttrans as per http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax If we keep the restarts in postuninstall then we should keep if [ "$1" -ge 1 ]; then clause (in addition to the check for the sysconfig file to prevent restarts). Cloned for RHEL7 to bug 1200713. Verified in nfs-utils-1.2.3-58.el6.x86_64 ========================================== [root@hp-dl385pg8-10 ~]# touch /etc/sysconfig/nfs-utils-disable-posttrans [root@hp-dl385pg8-10 ~]# exportfs -v /export <world>(rw,wdelay,root_squash,no_subtree_check) [root@hp-dl385pg8-10 ~]# mkdir /export_exportfs [root@hp-dl385pg8-10 ~]# exportfs -i localhost:/export_exportfs/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Export NFS shares manually (using exportfs) [root@hp-dl385pg8-10 ~]# exportfs -v /export_exportfs localhost(ro,wdelay,root_squash,no_subtree_check) /export <world>(rw,wdelay,root_squash,no_subtree_check) [root@hp-dl385pg8-10 ~]# rpm -q nfs-utils nfs-utils-1.2.3-56.el6.x86_64 [root@hp-dl385pg8-10 ~]# rpm -Uvh nfs-utils-1.2.3-58.el6.x86_64.rpm Preparing... ########################################### [100%] 1:nfs-utils ########################################### [100%] exportfs: scandir /etc/exports.d: No such file or directory [root@hp-dl385pg8-10 ~]# rpm -q nfs-utils nfs-utils-1.2.3-58.el6.x86_64 [root@hp-dl385pg8-10 ~]# exportfs -v /export <world>(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,root_squash,no_all_squash) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ With original nfs-utils, will restart NFS daemons even if file /etc/sysconfig/nfs-utils-disable-posttrans exists [root@hp-dl385pg8-10 ~]# exportfs -i localhost:/export_exportfs/ [root@hp-dl385pg8-10 ~]# exportfs -v /export_exportfs localhost(ro,wdelay,root_squash,no_subtree_check,sec=sys,ro,root_squash,no_all_squash) /export <world>(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,root_squash,no_all_squash) [root@hp-dl385pg8-10 ~]# cat /etc/sysconfig/nfs-utils-disable-posttrans [root@hp-dl385pg8-10 ~]# ls -l /etc/sysconfig/nfs-utils-disable-posttrans -rw-r--r--. 1 root root 0 Mar 23 18:22 /etc/sysconfig/nfs-utils-disable-posttrans [root@hp-dl385pg8-10 ~]# rpm -Uvh nfs-utils-1.2.3-59.el6.x86_64.rpm Preparing... ########################################### [100%] 1:nfs-utils ########################################### [100%] [root@hp-dl385pg8-10 ~]# exportfs -v /export_exportfs localhost(ro,wdelay,root_squash,no_subtree_check,sec=sys,ro,root_squash,no_all_squash) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Not restart NFS daemons if file /etc/sysconfig/nfs-utils-disable-posttrans exists /export <world>(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,root_squash,no_all_squash) [root@hp-dl385pg8-10 ~]# ========================================== Move to VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1342.html |