E
E
Eugene Wolf2019-01-29 18:44:00
linux
Eugene Wolf, 2019-01-29 18:44:00

Supervisor + fcgiwrap, how to set owner on unix-socket?

Good day, dear ones!
Given: Docker + Linux + supervisor + fcgiwrap. You need to run fcgiwrap , specify unix-socket and assign rights to it. Of course, there is no initialization system, so supervisor is used , config:

[program:fcgi-wrap]
command=/usr/sbin/fcgiwrap -s unix:/var/run/hello.sock
process_name=%(program_name)s_%(process_num)02d
numprocs=1
autostart=true

In this mode, it works, the socket is created, but the owner / group of it is root . Tried as they write here , incl. as they write in the answer, if the socket has already been created earlier - fcgiwrap does not start (it crashes with an error that it cannot close the socket), in another version - it simply ignores the socket (which is expected in principle).
I tried to feed him environment variables, both through supervisor and through ENV in the Dockerfile... The man says :
Most probably you will want to launch fcgiwrap by spawn-fcgi using a configuration like this

Only it is not written where this very configuration file should lie and how to feed it to fcgiwrap?
Can you please tell me how to pass parameters (user:group + rights) to fcgiwrap under which a unix socket should be created in supervisor?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Klimanov, 2019-01-29
@Wolfnsex

I don’t understand what docker and supervisord have to do with it.
Are you running a docker container and have a supervisor inside it? Or are you running the docker container and fcgiwrap with supervisor?
Why are you not satisfied with root as the owner of the socket, if it is inside a container?
If supervisor and fcgiwrap are inside the container, then just specify from which user to run the container with all this via "docker run --user".
You can also add the socket itself and the rights to it to the supervisor config, and specify in the command fcgiwrap which socket to use.

[program:fcgi-wrap]
command=/usr/sbin/fcgiwrap -s unix:/var/run/hello.sock
process_name=%(program_name)s_%(process_num)02d
numprocs=1
autostart=true
user = some_user
socket = unix:///var/run/hello.sock
socket_owner = some_user:some_group
socket_mode = 0770

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question