502 when fiddling with the socket permissions and --umask. Suggestions for restricting socket permissions? #3431
-
|
I am running a With default settings all works fine and I have these permissions for the socket and its dir: Then I stop everything, delete the socket and change the permissions of the socket dir with The socket dir has now this permissions (and getting 502): Here are the two systemd gunicorn-related service files: and Given that I want to restrict the socket permissions and its parent dir to
Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Do not mix gunicorns own permission/uid fiddling with systemd. If you launch via systemd, let systemd handle all of that.
Which means that a) runtime data of the application and b) the (optional: separate folder with the) socket that can be accessed by nginx do not need any overlap in permissions, and all runtime folders are automatically managed. Setting Side note: Socket file permissions are a thing on Linux, but not on other UNIX platforms. This is why you'll often find documentation caring to point out that the socket needs to be in a separate directory for (the folder!) permission to apply. Good for consistency, but not strictly needed when targeting Linux-exclusive systemd. |
Beta Was this translation helpful? Give feedback.
Do not mix gunicorns own permission/uid fiddling with systemd. If you launch via systemd, let systemd handle all of that.
(the example in https://docs.gunicorn.org/en/latest/deploy.html#systemd does this.. but I guess it does not do a very good job at explaining so.)
RuntimeDirectory=,StateDirectory=,CacheDirectory=, .. andRuntimeDirectoryMode=, .. - if you need any at all.SocketMode=0660is fineWhich means that a) runtime data of the application an…