On Tue, 2024-07-30 at 09:12 +0000, Christian Bricart wrote:
> just my 2¢ here and sorry if I might have overlookt a rationale earlier
> 
> why moving nginx's temp dir to "generic purpose" /var/tmp/… and not keeping
> it at /var/lib/nginx/tmp/* ?

TLDR: Because /var/tmp is designated for temporary files, unlike /var/lib.

The Filesystem Hierarchy Standard (FHS)[1] describes /var/tmp as a directory
storing "temporary files preserved between reboots"[2], which is much closer to
our purpose of storing temporary NGINX files. Conversely, /var/lib stores
persistent information (databases, etc.), not temporary files.

Note: While FHS is not an authoritative standard for Gentoo, it is a good set of
sensible guidelines for a software packager.

[1]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
[2]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html

> Especially, when there even is/would be a tmpfiles entry taking care of it's
> existence and ownership.
> 
> Christian
> 
> Am 29.07.24 um 23:52 schrieb Zurab Kvachadze:
> > This places the burden on creating and cleaning /var/tmp/nginx in
> > world-writable /var/tmp on systemd-tmpfiles(8).
> > 
> > Signed-off-by: Zurab Kvachadze <zurabid2...@gmail.com>
> > ---
> >   www-servers/nginx/files/nginx.tmpfiles | 2 ++
> >   1 file changed, 2 insertions(+)
> >   create mode 100644 www-servers/nginx/files/nginx.tmpfiles
> > 
> > diff --git a/www-servers/nginx/files/nginx.tmpfiles 
> > b/www-servers/nginx/files/nginx.tmpfiles
> > new file mode 100644
> > index 000000000000..af9cdd26973f
> > --- /dev/null
> > +++ b/www-servers/nginx/files/nginx.tmpfiles
> > @@ -0,0 +1,2 @@
> > +D /var/tmp/nginx 0755 root root
> > +x /var/tmp/nginx

Reply via email to