Re: How to install a mountpoint directory from an rpm?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2019-04-30 at 17:29 +0000, Zbigniew Jędrzejewski-Szmek wrote:
> On Tue, Apr 30, 2019 at 01:12:43PM -0400, Robert Marcano wrote:
> > On 4/30/19 11:45 AM, David Howells wrote:
> > > Hi,
> > > 
> > > I need to install a directory (/afs) that will be a mountpoint that a
> > > systemd
> > > service (also installed in the rpm) will mount upon.

I seem to remember you can't create root level directories from a
program either.

So the user needs to create these directories manually!

That problem hasn't been reported for a while so this may have changed.

> 
> Nope. New top-level directories are a big thing and need FPC approval:
> 
https://fedoraproject.org/w/index.php?title=Packaging:Guidelines&oldid=528452#Filesystem_Layout
> (I can't find the text in the new guidelines, but the new guidelines don't
> support searching, so finding anything is PITA, so I'll just assume that
> this is still valid...)

That's a great idea.

So, as has been happening, I have to advise users that they must create
any mount point directories they need in / manually before starting autofs.

It's this sort of policy that makes me want to close bugs for this without
any explanation of why the problem occurs!

> 
> Regarding the FPC approval: I don't think it should be granted. There
> is no good reason to create a mount point like this under root. It should go
> somewhere under /run or /var.

Rubbish, the package is following long standing conventions, there's no
good reason to prevent this and, while it may be possible in this case,
it's not always possible to know what directory (or directories) will
need to be created therefore it's not possible to seek approval.

> 
> Zbyszek
> 
> 
> > > 
> > > What's the best way to encode this in the specfile?
> > > 
> > > I did have:
> > > 
> > > 	%files
> > > 	/afs
> > > 
> > > but that doesn't upgrade correctly.  Someone gave me another way to do it:
> > 
> > Just create it on your %install section
> > 
> >   mkdir $RPM_BUILD_ROOT/afs
> > 
> > and continue adding the reference on the %files like:
> > 
> > %file
> > %dir /afs
> > 
> > > 
> > > 	%post
> > > 	%systemd_post afs.mount
> > > 
> > > 	# Create /afs directory if it doesn't exist
> > > 	if [ ! -d /afs ]; then
> > > 	    mkdir /afs
> > > 	    chown root.root /afs
> > > 	    chmod 0755 /afs
> > > 	    [ -x /usr/sbin/restorecon ] && /usr/sbin/restorecon /afs
> > > 	fi
> > > 
> > > 	%files
> > > 	%ghost %dir /afs
> > > 
> > > but rpmlint complains about the chown:
> > > 
> > > 	kafs-client.x86_64: W: dangerous-command-in-%post chown
> > > 
> > > The git repo is here:
> > > 
> > > 	
> > > http://git.infradead.org/users/dhowells/kafs-client.git/shortlog/refs/heads/next
> > > 
> > > 
> > > The second patch from the top is the one that tries to fix the mountpoint
> > > dir
> > > installation issue ("spec: Treat /afs special").
> > > 
> > > Thanks,
> > > David
> > > _______________________________________________
> > > devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
> > > To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> > > Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
> > > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> > > List Archives: 
> > > https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
> > > 
> > 
> > _______________________________________________
> > devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
> > To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> > Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
> > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> > List Archives: 
> > https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
> 
> _______________________________________________
> devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux