On Mon, Apr 26, 2021 at 11:03 AM Stefan Bethke <s...@lassitu.de> wrote:

> Am 13.04.2021 um 10:24 schrieb Stefan Bethke <s...@lassitu.de>:
> >
> > As the maintainer, I've received this bug report:
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255009
> >
> > If you'd like to run the daemon under a user different from the default
> git, you also need to change the ownership of the working directories,
> especially /var/*/gitea.
> >
> > The expectation is that upgrading the package will not change the
> ownership of already existing directories. When installing a newer version
> of the package, pkg appears to reset the ownership to those specified in
> the package.
> >
> > The pkg-plist has this:
> > @owner git
> > @group git
> > @dir /var/db/gitea
> > @dir /var/log/gitea
> > @dir /var/run/gitea
> >
> > I believe this to be best practice. Is there a better way to have pkg
> create these dirs if they're missing, but not touch them if they are there
> already?
>
> Adam has suggested a couple of approaches, but what I would really like is
> a common, documented way for ports to handle this situation.
>
> Updating ownership and mode of entries in the rc script automatically
> feels wrong to me, especially if it's a custom one-off for a single port.
> Kinda creating a POLA violation.
>
> I think as a general approach, checking that directories and files that
> the port knows will need to be writable for compatible access rights might
> be the safe choice.
>
> But that still leaves pkg updating the ownership/mode of existing
> directories as a surprise on updating a package. I think the "right" thing
> here would be a kind of three-way merge between changes an updated package
> brings in vs. changes the user has made on their system. That sound
> complicated to get right.
>
>
> Stefan
>
> --
> Stefan Bethke <s...@lassitu.de>   Fon +49 151 14070811
>

I believe the general approach is what is called tmpfiles.d in systemd. It
is a startup script that reads configuration files installed by 3rd-party
software and creates file system hierarchies according to them. This is an
example of such configuration file:
https://github.com/Xpra-org/xpra/blob/master/fs/lib/tmpfiles.d/xpra.conf

Maybe we need to grow our own implementation of tmpfiles.d.
_______________________________________________
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Reply via email to