I have a gunicorn service managed by systemd on a Debian Buster server. Here is the /etc/system.d/system/my_site
file:
[Unit]
Description=gunicorn daemon for my site
Requires=my_site.socket
After=network.target
[Service]
Type=notify
User=someuser
Group=somegroup
WorkingDirectory=/home/soemuser/my_site/
ExecStart=/home/someuser/my_site_env/bin/gunicorn --bind unix:/run/gunicorn.my_site.sock --workers 2 --log-file /var/log/my_site.log my_site.wsgi:application
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target
This logs some gunicorn and my_site output to /var/log/my_site.log
, great! The problem is that the log file is created with the following permissions: -rw-rw-rw- root root
. Not so good.
How can I change the ownership and permissions on the created log file?
Unless I missed something there is nothing about it in the gunicorn doc.