Bug 1179412
| Summary: | nfs options went missing in nfsserver after updating to 3.9.5-12.el6 | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Cedric Buissart <cbuissar> | |
| Component: | resource-agents | Assignee: | David Vossel <dvossel> | |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | 6.7 | CC: | agk, cbuissar, cluster-maint, djansa, fdinitto, mnovacek, nyewale, sbeal | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | GSSApproved | |||
| Fixed In Version: | resource-agents-3.9.5-20.el6 | Doc Type: | Bug Fix | |
| Doc Text: |
Due to a regression, some NFS options went missing in the nfsserver after updating, and it was impossible to modify the number of the NFS thread. A patch has been applied, and the number is now modifiable.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1182787 (view as bug list) | Environment: | ||
| Last Closed: | 2015-07-22 06:12:35 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: | 1182787 | |||
|
Description
Cedric Buissart
2015-01-06 17:41:09 UTC
For solution A) merging the changes into an existing sysconfig/nfs, we might want to check along these lines :
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
index cb8635f..b2da5bc 100755
--- a/heartbeat/nfsserver
+++ b/heartbeat/nfsserver
@@ -391,7 +391,12 @@ set_arg()
# only write to the tmp /etc/sysconfig/nfs if sysconfig exists.
# otherwise this distro does not support setting these options.
if [ -d "/etc/sysconfig" ]; then
- echo "${key}=\"${value}\"" >> $file
+ # replace if the value exists, append otherwise
+ if grep "^\s*${key}=" $file ; then
+ sed -i "s/\s*${key}=.*$/${key}=\"${value}\"/" $file
+ else
+ echo "${key}=\"${value}\"" >> $file
+ fi
elif [ "$requires_sysconfig" = "true" ]; then
ocf_log warn "/etc/sysconfig/nfs not found, unable to set port and nfsd args."
fi
@@ -404,6 +409,9 @@ set_env_args()
local tmpconfig=$(mktemp ${HA_RSCTMP}/nfsserver-tmp-XXXXX)
local statd_args
+ ## Take the $NFS_SYSCONFIG file as our skeleton
+ cp $NFS_SYSCONFIG $tmpconfig
+
# nfsd args
set_arg "RPCNFSDARGS" "$OCF_RESKEY_nfsd_args" "$tmpconfig" "true"
For Solution B) adding a parameter to add generic option, the following might be a start :
parameter example : generic_vars=KEY1=value1,KEY2=value2
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
index cb8635f..4237d18 100755
--- a/heartbeat/nfsserver
+++ b/heartbeat/nfsserver
@@ -432,6 +432,14 @@ set_env_args()
set_arg "RPCRQUOTADOPTS" "-p $OCF_RESKEY_rquotad_port" "$tmpconfig" "true"
fi
+ # Generic variables
+ local IFSbk=$IFS
+ IFS=,
+ for pair in $OCF_RESKEY_generic_vars ; do
+ set_arg ${pair%%=*} ${pair#*=} "$tmpconfig" "true"
+ done
+ IFS=$IFSbk
+
# override local nfs config. preserve previous local config though.
if [ -s $tmpconfig ]; then
cat $NFS_SYSCONFIG | grep -e "$NFS_SYSCONFIG_AUTOGEN_TAG"
(In reply to Cedric Buissart from comment #2) > For solution A) merging the changes into an existing sysconfig/nfs, we might > want to check along these lines : > > > diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver > index cb8635f..b2da5bc 100755 > --- a/heartbeat/nfsserver > +++ b/heartbeat/nfsserver > @@ -391,7 +391,12 @@ set_arg() > # only write to the tmp /etc/sysconfig/nfs if sysconfig exists. > # otherwise this distro does not support setting these options. > if [ -d "/etc/sysconfig" ]; then > - echo "${key}=\"${value}\"" >> $file > + # replace if the value exists, append otherwise > + if grep "^\s*${key}=" $file ; then > + sed -i "s/\s*${key}=.*$/${key}=\"${value}\"/" $file > + else > + echo "${key}=\"${value}\"" >> $file > + fi > elif [ "$requires_sysconfig" = "true" ]; then > ocf_log warn "/etc/sysconfig/nfs not found, unable to set port and nfsd > args." > fi > @@ -404,6 +409,9 @@ set_env_args() > local tmpconfig=$(mktemp ${HA_RSCTMP}/nfsserver-tmp-XXXXX) > local statd_args > > + ## Take the $NFS_SYSCONFIG file as our skeleton > + cp $NFS_SYSCONFIG $tmpconfig > + > # nfsd args > set_arg "RPCNFSDARGS" "$OCF_RESKEY_nfsd_args" "$tmpconfig" "true" I'm fine with this one. Do you have a github account? Would you be interested in submitting the pull request for review here, https://github.com/ClusterLabs/resource-agents -- David Cedric, Has any progress been made to get this patch upstream? I have verified that with resource-agents-3.9.5-20.el6.x86_64 the values contained in /etc/sysconfig/nfs are kept intact. [root@bucek-02 ~]# grep -v \# /etc/sysconfig/nfs LOCKD_UDPPORT=32769 before the patch resource-agents-3.9.5-19.el6.x86_64 ==================================================== [root@bucek-02 x86_64]# OCF_ROOT=/usr/lib/ocf OCF_RESKEY_lockd_tcp_port=32803 \ OCF_RESKEY_nfs_shared_infodir=/mnt/shared/nfs \ /usr/lib/ocf/resource.d/heartbeat/nfsserver start DEBUG: rpc.svcgssd is stopped rpc.mountd is stopped nfsd is stopped rpc.rquotad is stopped # AUTOGENERATED by /usr/lib/ocf/resource.d/heartbeat/nfsserver high availability resource-agent INFO: Starting NFS server ... INFO: Starting rpc.statd. DEBUG: Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Starting RPC idmapd: [ OK ] INFO: executing sm-notify INFO: NFS server started [root@bucek-02 x86_64]# grep -v \# /etc/sysconfig/nfs STATDARG="--no-notify" LOCKD_TCPPORT="32803" with patched version resource-agents-3.9.5-20.el6.x86_64 ======================================================== [root@bucek-02 ~]# OCF_ROOT=/usr/lib/ocf OCF_RESKEY_lockd_tcp_port=32803 \ OCF_RESKEY_nfs_shared_infodir=/mnt/shared/nfs \ /usr/lib/ocf/resource.d/heartbeat/nfsserver start DEBUG: rpc.svcgssd is stopped rpc.mountd is stopped nfsd is stopped rpc.rquotad is stopped INFO: Starting NFS server ... INFO: rpc.statd already up DEBUG: Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Starting RPC idmapd: [ OK ] INFO: executing sm-notify INFO: NFS server started [root@bucek-02 ~]# grep -v \# /etc/sysconfig/nfs LOCKD_UDPPORT=32769 STATDARG="--no-notify" LOCKD_TCPPORT="32803" 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-1280.html |