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.

2 Answers 2

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.

2
  • Ah I see! That did the trick, thank you. How come most sources on this topic only mention fcgiwrap_user? Could it be that this has been changed since then? Commented Apr 13, 2017 at 16:52
  • 1
    There is a lot of bad advice out there :-) Commented Apr 13, 2017 at 16:55
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".

1
  • That is nice to know too! Thanks for pointing it out. Commented Apr 21, 2017 at 23:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.