Log file permissions

I am quite stuck trying to set up access/error logging for nginx.

nobody 17992 0.0 0.1 76872 1144 ?? S 12:20am 0:00.00
nginx: worker process
nobody 17991 0.0 0.1 76872 1140 ?? S 12:20am 0:00.00
nginx: worker process
root 17990 0.0 0.0 76072 232 ?? Ss 12:20am 0:00.00
nginx: master process /opt/local/sbin/nginx

$ ls -al /var/log/testin2.local/
total 0
drwxrwxr-x 3 root nobody 102 30 May 00:17 .
drwxr-xr-x 85 root wheel 2890 30 May 00:00 …
-rwxrwx— 1 root nobody 5496 30 May 00:21 www.access.log

I run nginx as nobody:nobody, and group nobody should have write
access to the log file, even so it fails with this message:

30/05/2008 11:27:15 org.macports.nginx[20671] 2008/05/30 11:27:14
[emerg] 20672#0: open() “/var/log/testin2.local/www.access.log” failed
(13: Permission denied)
30/05/2008 11:27:45 com.apple.launchd[112] (org.macports.nginx[20671])
Exited with exit code: 2

Is it expecting the user to have the write permissions?

Henrik

On Fri, May 30, 2008 at 6:29 PM, Henrik Vendelbo <
[email protected]> wrote:

I run nginx as nobody:nobody, and group nobody should have write
access to the log file, even so it fails with this message:

does anybody have write permissions to the containing directly? or does
nobody have it?

-jf’


In the meantime, here is your PSA:
“It’s so hard to write a graphics driver that open-sourcing it would not
help.”
– Andrew Fear, Software Product Manager, NVIDIA Corporation

I have tried with containing directory chown root:nobody and
nobody:nobody, I have even tried giving everyone write access with
chmod. Makes no difference.

It’s odd.

On Fri, May 30, 2008 at 6:37 PM, Jeffrey ‘jf’ Lim [email protected]
wrote:

drwxr-xr-x 85 root wheel 2890 30 May 00:00 …
-rwxrwx— 1 root nobody 5496 30 May 00:21 www.access.log

I run nginx as nobody:nobody, and group nobody should have write
access to the log file, even so it fails with this message:

does anybody have write permissions to the containing directly? or does
nobody have it?

containing directory, sorry.

-jf


In the meantime, here is your PSA:
“It’s so hard to write a graphics driver that open-sourcing it would not
help.”
– Andrew Fear, Software Product Manager, NVIDIA Corporation

Hmm, seems I have gotten a bit further. If I create the log files
myself and make them group writable with root:nobody, it doesn’t write
an error. It still terminates the nginx process though, I wonder if
that is launchd getting confused by the master forking mechanism.

On Sat, May 31, 2008 at 10:55 PM, Henrik Vendelbo