3

I'm trying to setup nginx and cgit on FreeBSD but nginx can't access /var/run/fcgiwrap/fcgiwrap.sock.

In my /etc/rc.conf I already set fcgiwrap_user="www", and www is also the user nginx runs as.

When I make fcgiwrap.sock owned by www by performing chown www /var/run/fcgiwrap/fcgiwrap.sock, everything works the way I want.

However this is of course not the proper way to do this, and it will only last until reboot.

I was under the assumption that setting fcgiwrap_user="www" would also determine this.

Am I missing something?

Update:

I noticed that when I use service fcgiwrap start or restart, the message Starting fcgiwrap is followed by chmod: /var/run/fcgiwrap/fcgiwrap.sock: No such file or directory. However /var/run/fcgiwrap/fcgiwrap.sock does exist afterwards.

Jessica Nowak
  • 57
  • 1
  • 8

2 Answers2

8

The RC script is located at /usr/local/etc/rc.d/fcgiwrap.

Looking at the code, fcgiwrap_user sets the owner of the process running the daemon (default root).

You need to set fcgiwrap_socket_owner="www" to set the owner of the socket.

Richard Smith
  • 1,243
  • 1
  • 8
  • 13
2

The answer of Richard Smith also worked for me but in my case I also had to set fcgiwrap_socket_group="www". These settings seem to be new because earlier it was sufficient to set fcgiwrap_user="www".

Zilon
  • 21
  • 1