[Bug 270075] www/nginx: automatically create log dir

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 09 Mar 2023 22:13:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270075

            Bug ID: 270075
           Summary: www/nginx: automatically create log dir
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: joneum@FreeBSD.org
          Reporter: pat@patmaddox.com
             Flags: maintainer-feedback?(joneum@FreeBSD.org)
          Assignee: joneum@FreeBSD.org

Created attachment 240710
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=240710&action=edit
patch to automatically create log dir

Currently, if you `rm -rf /var/log/nginx && service nginx start` it will fail
with:

    Performing sanity check on nginx configuration:
    nginx: [alert] could not open error log file: open()
"/var/log/nginx/error.log" failed (2: No such file or directory)
    nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
    2023/03/09 14:04:33 [emerg] 11385#110709: open()
"/var/log/nginx/access.log" failed (2: No such file or directory)
    nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
    Starting nginx.
    nginx: [alert] could not open error log file: open()
"/var/log/nginx/error.log" failed (2: No such file or directory)
    2023/03/09 14:04:33 [emerg] 11564#110709: open()
"/var/log/nginx/access.log" failed (2: No such file or directory)
    /usr/local/etc/rc.d/nginx: WARNING: failed to start nginx

This patch automatically creates the log dir before nginx runs.

-- 
You are receiving this mail because:
You are the assignee for the bug.