%dir and NFS

FlorianFesti ffesti at redhat.com
Wed Oct 27 06:57:51 UTC 2010

  On 10/22/2010 08:22 PM, Stuart D. Gathman wrote:
> I have an RPM with "%dir /bms/airpex/reports".  It gets an error on install
> because there is typically an NFS filesystem mounted on that dir.
> It tries to set the permissions even though they are already as specified.
>   error: unpacking of archive failed on file
>   /bms/airpex/reports: cpio: chown failed - Operation not permitted
>   a) is this a bug?
>   b) should I just have a %post to make the dir only if it doesn't exist?  How
>      can the rpm then "own" the directory?
> I considered "umount" in %pre and "mount" in %post, but that could disrupt
> operation on upgrade.  (Actually, the umount would just fail)
> The package is for a document repository, and the repository directory
> is often mounted on NAS in production.
> Another option is to simply leave the directory out of the RPM, and let
> the admin create it and mount an appropriate filesystem on it.
> Any advice?
Have a look at the --excludepath option and the %_netsharedpath macro in 
/usr/lib/rpm/macros (you should not alter /usr/lib/rpm/macros itself but 
either create a ~/.rpmmacros or /etc/rpm/macros.local file)


More information about the Rpm-list mailing list