[MacPorts] #68596: After installing Nginx, I can't shut down Redis (also installed by port) because the error "Failed opening the temp RDB file temp-8712.rdb (in server root dir /opt/local/var/log/nginx) for saving: Permission denied"

MacPorts noreply at macports.org
Tue Oct 31 10:49:36 UTC 2023


#68596: After installing Nginx, I can't shut down Redis (also installed by port)
because the error "Failed opening the temp RDB file temp-8712.rdb (in
server root dir /opt/local/var/log/nginx) for saving: Permission denied"
--------------------------+-------------------------
  Reporter:  qiulang      |      Owner:  Schamschula
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:               |   Keywords:
      Port:  nginx redis  |
--------------------------+-------------------------
Description changed by ryandesign:

Old description:

> After installing Nginx, I can't shut down Redis (also installed by port)
> because the error "Failed opening the temp RDB file temp-8712.rdb (in
> server root dir /opt/local/var/log/nginx) for saving: Permission denied."
>
> After installing Nginx, when started it, I got the error because the
> directory /opt/local/var/log/nginx is owned by root.
>
> % nginx
> nginx: [alert] could not open error log file: open()
> "/opt/local/var/log/nginx/error.log" failed (13: Permission denied)
> 2023/10/31 11:28:09 [emerg] 8608#0: mkdir()
> "/opt/local/var/run/nginx/client_body_temp" failed (13: Permission
> denied)
>
> So I run nginx with sudo nginx.
>
> But when I just run redis-server (without sudo redis-server) and later
> want to shut it down, I got the error "Failed opening the temp RDB file
> temp-8712.rdb (in server root dir /opt/local/var/log/nginx) for saving:
> Permission denied." Why does Redis need to write log into dir
> /opt/local/var/log/nginx?
>

> My second question is do I need to run nginx with sudo ngixn? When I run
> all other tool installed by port I don't need to run them with sudo.

New description:

 After installing Nginx, I can't shut down Redis (also installed by port)
 because the error "Failed opening the temp RDB file temp-8712.rdb (in
 server root dir /opt/local/var/log/nginx) for saving: Permission denied."

 After installing Nginx, when started it, I got the error because the
 directory /opt/local/var/log/nginx is owned by root.

 {{{
 % nginx
 nginx: [alert] could not open error log file: open()
 "/opt/local/var/log/nginx/error.log" failed (13: Permission denied)
 2023/10/31 11:28:09 [emerg] 8608#0: mkdir()
 "/opt/local/var/run/nginx/client_body_temp" failed (13: Permission denied)
 }}}

 So I run nginx with sudo nginx.

 But when I just run redis-server (without sudo redis-server) and later
 want to shut it down, I got the error "Failed opening the temp RDB file
 temp-8712.rdb (in server root dir /opt/local/var/log/nginx) for saving:
 Permission denied." Why does Redis need to write log into dir
 /opt/local/var/log/nginx?


 My second question is do I need to run nginx with sudo ngixn? When I run
 all other tool installed by port I don't need to run them with sudo.

--

-- 
Ticket URL: <https://trac.macports.org/ticket/68596#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list