After upgraded to Rhel 8.2 - Building RPM- %Clean error - Device or resource busy/Directory not empty

LeaAbrugena

New Member
Joined
Jul 10, 2020
Messages
1
Reaction score
0
Credits
14
Hi,

Just when we upgraded our Linux box to Rhel 8.2 , we encountered below errors in %clean section of RPM Spec File during build. Not sure if this is because of upgrade or if there’s other issue behind.
I tried to put some delay(sleep 1m) before deletion but still not success.
It was successful when I deleted the folders manually.
Any thought? Please advise. Thanks.

Command in the script:
%clean
find %{buildroot} -type f -delete && rm -r %{buildroot}

rm: cannot remove '/remote/ds/x86_64/proj/usr/47/abr/rpmbuild/BUILDROOT/fcp-4.7.0-0.x86_64/tmp/fcp.install/fcp/sys/.nfs000000000304f88f00000316': Device or resource busy
rm: cannot remove '/remote/ds/x86_64/proj/usr/47/abr/rpmbuild/BUILDROOT/fcp-4.7.0-0.x86_64/usr/share/doc/fcp/.nfs000000000304f8aa00000321': Device or resource busy
error: Bad exit status from /remote/ds/x86_64/proj/usr/47/abr/rpmbuild/tmp/rpm-tmp.6QuE8v (%clean)


But when I use:
rm -rf %{buildroot}

rm: cannot remove '/remote/ds/x86_64/proj/usr/47/abr/rpmbuild/BUILDROOT/fcp-4.7.0-0.x86_64/tmp/fcp.install/fcp/bin': Directory not empty
rm: cannot remove '/remote/ds/x86_64/proj/usr/47/abr/rpmbuild/BUILDROOT/fcp-4.7.0-0.x86_64/tmp/fcp.install/fcp/include': Directory not empty
 
Last edited:


i'm moving a software product from rhel7.x to rhel8 just this week. so i started with 8.2 because that was the latest. i don't have a %clean in my .spec, but i get similar errors:
Code:
Wrote: ./<snip>-5.2.428.g3a3f2aee-1.el8.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.ALKfqp
+ umask 022
+ cd /home/joycepg/rpmbuild/BUILD
+ /usr/bin/rm -rf /mnt/hgfs/<snip>/build/buildroot
/usr/bin/rm: cannot remove '/mnt/hgfs/<snip>/build/buildroot/usr/bin': Directory not empty
/usr/bin/rm: cannot remove '/mnt/hgfs/<snip>/build/buildroot/etc/nginx/conf.d': Directory not empty
/usr/bin/rm: cannot remove '/mnt/hgfs/<snip>/build/buildroot/opt/<snip>/server/configure': Directory not empty
error: Bad exit status from /var/tmp/rpm-tmp.ALKfqp (%clean)
i initially thought it was something to do with it being a vm running under vmware fusion, using the shared folder (/mnt/hgfs), but it might be a bug in rpmbuild?
 
actually, it did work ok off the normal filesystem (vhd), so it's possibly a race condition in the shared folder filesystem driver
 
another approach that worked: use --noclean to make rpmbuild not hit the error, and clean up afterwards with rm (it's usually a script running rpmbuild anyway)
 
What are the permissions on your /remote filesystem?

What is the output of "mount"
 

Members online


Latest posts

Top