Changing ownership of a directory when using staging

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Feb 22 19:25:14 UTC 2014


On 22/02/2014 19:05, Adam Weinberger wrote:
> How do I specify the owner/group and mode of a directory when using
> staging? It appears to automatically create every directory as
> root:wheel. Setting @user/@group in pkg-plist doesn't affect things with
> @exec mkdir.
> 
> The only thing I can figure is:
> @exec install -d -m 730 -o user -g group %D/path/to/dir
> 
> But that'll fail when installed by anyone except root, right?
> 
> This problem breaks usability of a number of ports---especially
> web-based ones where specific directories need specific owners. Every
> time www/dokuwiki is upgraded or reinstalled, a half dozen directories
> have to be manually chown'd on the command line, for example.

I had this with www/rt42 with the ${LOCALBASE}/etc/rt directory --
here's the solution I used in pkg-plist:

@mode 0440
etc/rt42/RT_Config.pm
@unexec if cmp -s %D/etc/rt42/RT_SiteConfig.pm-dist
%D/etc/rt42/RT_SiteConfig.pm ; then rm -f %D/etc/rt42/RT_SiteConfig.pm; fi
etc/rt42/RT_SiteConfig.pm-dist
@exec [ -f %B/RT_SiteConfig.pm ] || cp -p %D/%F %B/RT_SiteConfig.pm
@mode
etc/rt42/acl.Oracle
etc/rt42/acl.Pg
etc/rt42/acl.mysql
etc/rt42/initialdata
etc/rt42/schema.Oracle
etc/rt42/schema.Pg
etc/rt42/schema.SQLite
etc/rt42/schema.mysql
@exec chmod 0750 %D/etc/rt42
@exec chgrp rt %D/etc/rt42
@group

Would be nicer to create the directory with the right ownership and mode
in the first place, then copy the files to it, but that doesn't seem to
work given what you can go with a plist.

	Cheers,

	Matthew



-- 
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matthew at infracaninophile.co.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20140222/966d76f4/attachment-0001.sig>


More information about the freebsd-ports mailing list