Bug 1272841 - Upgrading rpcbind emit warning: triggerpostun(rpcbind-0.2.0-32.el7.x86_64) scriptlet failed, exit status 1
Upgrading rpcbind emit warning: triggerpostun(rpcbind-0.2.0-32.el7.x86_64) s...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpcbind (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-19 00:51 EDT by Yongcheng Yang
Modified: 2016-10-09 23:53 EDT (History)
7 users (show)

See Also:
Fixed In Version: rpcbind-0.2.0-33.el7.src.rpm
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-10-09 23:53:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Yongcheng Yang 2015-10-19 00:51:32 EDT
Description of problem:
When updating rpcbind to rpcbind-0.2.0-32.el7 on TPS machines, always get warning as following:
warning: %triggerpostun(rpcbind-0.2.0-32.el7.x86_64) scriptlet failed, exit status 1

And the root cause could be that it always return 1 if there is no *.xdr file in /var/lib/rpcbind/
[yyc@dhcp-12-138 ~]$ rpm -qp --triggers rpcbind-0.2.0-32.el7.x86_64.rpm 
triggerun scriptlet (using /bin/sh) -- rpcbind < 0.2.0-15
/usr/bin/systemd-sysv-convert --save rpcbind >/dev/null 2>&1 ||:
/bin/systemctl --no-reload enable rpcbind.service >/dev/null 2>&1
/sbin/chkconfig --del rpcbind >/dev/null 2>&1 || :
/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
triggerun scriptlet (using /bin/sh) -- rpcbind > 0.2.0-26
/bin/systemctl enable rpcbind.socket >/dev/null 2>&1 || :
triggerpostun scriptlet (using /bin/sh) -- rpcbind < 0.2.0-29
[ ! -d /run/rpcbind ] && mkdir /run/rpcbind
chown rpc:rpc /run/rpcbind
[ -f /var/lib/rpcbind/rpcbind.xdr ] && \
	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ will return 1
[ -f /var/lib/rpcbind/portmap.xdr ] && \
	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ will return 1
[yyc@dhcp-12-138 ~]$ 

Version-Release number of selected component (if applicable):
rpcbind-0.2.0-32.el7

How reproducible:
100% with TPS machines

Steps to Reproduce:
1. Empty /var/lib/rpcbind/
2. rpm -Uvh rpcbind-0.2.0-32.el7.x86_64.rpm

Actual results:

.qa.[root@x86-64-7w-v1 tps]# rpm -q rpcbind 
rpcbind-0.2.0-26.el7.x86_64
.qa.[root@x86-64-7w-v1 tps]# ls /var/lib/rpcbind/
.qa.[root@x86-64-7w-v1 tps]# rpm -Uvh rpcbind-0.2.0-32.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:rpcbind-0.2.0-32.el7             ################################# [ 50%]
Cleaning up / removing...
   2:rpcbind-0.2.0-26.el7             ################################# [100%]
warning: %triggerpostun(rpcbind-0.2.0-32.el7.x86_64) scriptlet failed, exit status 1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Reproduced
.qa.[root@x86-64-7w-v1 tps]# 

.qa.[root@x86-64-7c-v1 tps]# rpm -q rpcbind
rpcbind-0.2.0-26.el7.x86_64
.qa.[root@x86-64-7c-v1 tps]# ls /var/lib/rpcbind/
.qa.[root@x86-64-7c-v1 tps]# touch /var/lib/rpcbind/rpcbind.xdr
.qa.[root@x86-64-7c-v1 tps]# touch /var/lib/rpcbind/portmap.xdr
.qa.[root@x86-64-7c-v1 tps]# ls /var/lib/rpcbind/
portmap.xdr  rpcbind.xdr
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^workaround to get rip of the warning
.qa.[root@x86-64-7c-v1 tps]# 
.qa.[root@x86-64-7c-v1 tps]# rpm -q rpcbind 
rpcbind-0.2.0-26.el7.x86_64
.qa.[root@x86-64-7c-v1 tps]# rpm -Uvh rpcbind-0.2.0-32.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:rpcbind-0.2.0-32.el7             ################################# [ 50%]
Cleaning up / removing...
   2:rpcbind-0.2.0-26.el7             ################################# [100%]
.qa.[root@x86-64-7c-v1 tps]# echo $?
0
.qa.[root@x86-64-7c-v1 tps]# 

Expected results:
No warning appear

Additional info:
Maybe this is an easy fix as following patch:
[yyc@dhcp-12-138 SPECS]$ diff rpcbind.spec.old rpcbind.spec.new 
160c160
< 	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
---
> 	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind || :
162c162
< 	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind
---
> 	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind || :
[yyc@dhcp-12-138 SPECS]$ 

Testing logs:
.qa.[root@x86-64-7w-v1 tps]# ls /var/lib/rpcbind/
.qa.[root@x86-64-7w-v1 tps]# 
.qa.[root@x86-64-7w-v1 tps]# [ -f /var/lib/rpcbind/rpcbind.xdr ] && mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
.qa.[root@x86-64-7w-v1 tps]# echo $?
1
.qa.[root@x86-64-7w-v1 tps]# [ -f /var/lib/rpcbind/rpcbind.xdr ] && mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind || :
.qa.[root@x86-64-7w-v1 tps]# echo $?
0
.qa.[root@x86-64-7w-v1 tps]#
Comment 2 Karel Srot 2015-10-19 02:04:00 EDT
There is another bug in the postun trigger which is not doing restorecon on a newly created /run/rpcbind directory which resulted in faulty request on selinux-policy updated tracked in bug 1265266, see https://bugzilla.redhat.com/show_bug.cgi?id=1265266#c29.
Comment 3 Steve Dickson 2015-10-19 16:54:19 EDT
(In reply to Yongcheng Yang from comment #0)
> Description of problem:
> When updating rpcbind to rpcbind-0.2.0-32.el7 on TPS machines, always get
> warning as following:
> warning: %triggerpostun(rpcbind-0.2.0-32.el7.x86_64) scriptlet failed, exit
> status 1
> 
> And the root cause could be that it always return 1 if there is no *.xdr
> file in /var/lib/rpcbind/
> [yyc@dhcp-12-138 ~]$ rpm -qp --triggers rpcbind-0.2.0-32.el7.x86_64.rpm 
> triggerun scriptlet (using /bin/sh) -- rpcbind < 0.2.0-15
> /usr/bin/systemd-sysv-convert --save rpcbind >/dev/null 2>&1 ||:
> /bin/systemctl --no-reload enable rpcbind.service >/dev/null 2>&1
> /sbin/chkconfig --del rpcbind >/dev/null 2>&1 || :
> /bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
> triggerun scriptlet (using /bin/sh) -- rpcbind > 0.2.0-26
> /bin/systemctl enable rpcbind.socket >/dev/null 2>&1 || :
> triggerpostun scriptlet (using /bin/sh) -- rpcbind < 0.2.0-29
> [ ! -d /run/rpcbind ] && mkdir /run/rpcbind
> chown rpc:rpc /run/rpcbind
> [ -f /var/lib/rpcbind/rpcbind.xdr ] && \
> 	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ will return 1
> [ -f /var/lib/rpcbind/portmap.xdr ] && \
> 	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ will return 1
> [yyc@dhcp-12-138 ~]$ 
> 
> Version-Release number of selected component (if applicable):
> rpcbind-0.2.0-32.el7
> 
> How reproducible:
> 100% with TPS machines
> 
> Steps to Reproduce:
> 1. Empty /var/lib/rpcbind/
> 2. rpm -Uvh rpcbind-0.2.0-32.el7.x86_64.rpm
> 
> Actual results:
> 
> .qa.[root@x86-64-7w-v1 tps]# rpm -q rpcbind 
> rpcbind-0.2.0-26.el7.x86_64
> .qa.[root@x86-64-7w-v1 tps]# ls /var/lib/rpcbind/
> .qa.[root@x86-64-7w-v1 tps]# rpm -Uvh rpcbind-0.2.0-32.el7.x86_64.rpm 
> Preparing...                          #################################
> [100%]
> Updating / installing...
>    1:rpcbind-0.2.0-32.el7             ################################# [
> 50%]
> Cleaning up / removing...
>    2:rpcbind-0.2.0-26.el7             #################################
> [100%]
> warning: %triggerpostun(rpcbind-0.2.0-32.el7.x86_64) scriptlet failed, exit
> status 1
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Reproduced
> .qa.[root@x86-64-7w-v1 tps]# 
> 
> .qa.[root@x86-64-7c-v1 tps]# rpm -q rpcbind
> rpcbind-0.2.0-26.el7.x86_64
> .qa.[root@x86-64-7c-v1 tps]# ls /var/lib/rpcbind/
> .qa.[root@x86-64-7c-v1 tps]# touch /var/lib/rpcbind/rpcbind.xdr
> .qa.[root@x86-64-7c-v1 tps]# touch /var/lib/rpcbind/portmap.xdr
> .qa.[root@x86-64-7c-v1 tps]# ls /var/lib/rpcbind/
> portmap.xdr  rpcbind.xdr
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^workaround to get rip of the
> warning
> .qa.[root@x86-64-7c-v1 tps]# 
> .qa.[root@x86-64-7c-v1 tps]# rpm -q rpcbind 
> rpcbind-0.2.0-26.el7.x86_64
> .qa.[root@x86-64-7c-v1 tps]# rpm -Uvh rpcbind-0.2.0-32.el7.x86_64.rpm 
> Preparing...                          #################################
> [100%]
> Updating / installing...
>    1:rpcbind-0.2.0-32.el7             ################################# [
> 50%]
> Cleaning up / removing...
>    2:rpcbind-0.2.0-26.el7             #################################
> [100%]
> .qa.[root@x86-64-7c-v1 tps]# echo $?
> 0
> .qa.[root@x86-64-7c-v1 tps]# 
> 
> Expected results:
> No warning appear
> 
> Additional info:
> Maybe this is an easy fix as following patch:
> [yyc@dhcp-12-138 SPECS]$ diff rpcbind.spec.old rpcbind.spec.new 
> 160c160
> < 	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
> ---
> > 	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind || :
> 162c162
> < 	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind
> ---
> > 	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind || :
> [yyc@dhcp-12-138 SPECS]$ 
> 
> Testing logs:
> .qa.[root@x86-64-7w-v1 tps]# ls /var/lib/rpcbind/
> .qa.[root@x86-64-7w-v1 tps]# 
> .qa.[root@x86-64-7w-v1 tps]# [ -f /var/lib/rpcbind/rpcbind.xdr ] && mv
> /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
> .qa.[root@x86-64-7w-v1 tps]# echo $?
> 1
Why is it returning 1? 

Is there any error message?
Comment 4 Yongcheng Yang 2015-10-20 03:25:40 EDT
(In reply to Steve Dickson from comment #3)
> (In reply to Yongcheng Yang from comment #0)
> > .qa.[root@x86-64-7w-v1 tps]# [ -f /var/lib/rpcbind/rpcbind.xdr ] && mv
> > /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
> > .qa.[root@x86-64-7w-v1 tps]# echo $?
> > 1
> Why is it returning 1? 
> 
> Is there any error message?

[ -f /var/lib/rpcbind/rpcbind.xdr ] && mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
- if "/var/lib/rpcbind/rpcbind.xdr" exists, execute the mv command;
- if there is no rpcbind.xdr exists, will not mv and return 1

[root@ibm-x3250m4-07 ~]# [ -f no_exists ] && echo "exists"
[root@ibm-x3250m4-07 ~]# echo $?
1
[root@ibm-x3250m4-07 ~]# [ -f no_exists ] && echo "exists" || :
[root@ibm-x3250m4-07 ~]# echo $?
0
[root@ibm-x3250m4-07 ~]#
Comment 5 Steve Dickson 2015-10-20 10:47:31 EDT
(In reply to Yongcheng Yang from comment #4)
> (In reply to Steve Dickson from comment #3)
> > (In reply to Yongcheng Yang from comment #0)
> > > .qa.[root@x86-64-7w-v1 tps]# [ -f /var/lib/rpcbind/rpcbind.xdr ] && mv
> > > /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
> > > .qa.[root@x86-64-7w-v1 tps]# echo $?
> > > 1
> > Why is it returning 1? 
> > 
> > Is there any error message?
> 
> [ -f /var/lib/rpcbind/rpcbind.xdr ] && mv /var/lib/rpcbind/rpcbind.xdr
> /run/rpcbind
> - if "/var/lib/rpcbind/rpcbind.xdr" exists, execute the mv command;
> - if there is no rpcbind.xdr exists, will not mv and return 1
> 
> [root@ibm-x3250m4-07 ~]# [ -f no_exists ] && echo "exists"
> [root@ibm-x3250m4-07 ~]# echo $?
> 1
> [root@ibm-x3250m4-07 ~]# [ -f no_exists ] && echo "exists" || :
> [root@ibm-x3250m4-07 ~]# echo $?
> 0
Ok... I see...

Is is there time to make it into 7.2? Tom?
Comment 11 Yongcheng Yang 2016-10-09 23:53:59 EDT
This issue has been fixed in rpcbind-0.2.0-33.el7

Note You need to log in before you can comment on or make changes to this bug.