diff --git a/conf/funkwhale-beat.service b/conf/funkwhale-beat.service index 0ed3a3e..945288b 100644 --- a/conf/funkwhale-beat.service +++ b/conf/funkwhale-beat.service @@ -9,8 +9,9 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/code/api EnvironmentFile=__FINALPATH__/code/config/.env -# https://www.freedesktop.org/software/systemd/man/systemd.exec.html#RuntimeDirectory= -LogsDirectory=__APP__ +PermissionsStartOnly=true +ExecStartPre=/bin/mkdir -p /var/log/__APP__ +ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__ ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp beat \ --loglevel INFO --logfile=/var/log/__APP__/beat.log @@ -22,7 +23,7 @@ ProtectSystem=strict ProtectControlGroups=yes ProtectKernelModules=yes ReadOnlyPaths=__FINALPATH__/code/config/.env __FINALPATH__/code/ -ReadWritePaths=__FINALPATH__/media __FINALPATH__/import __FINALPATH__/code/api +ReadWritePaths=__FINALPATH__/media __FINALPATH__/import __FINALPATH__/code/api /var/log/__APP__ StandardOutput=syslog StandardError=syslog diff --git a/conf/funkwhale-server.service b/conf/funkwhale-server.service index 2120af4..c19144b 100644 --- a/conf/funkwhale-server.service +++ b/conf/funkwhale-server.service @@ -9,10 +9,11 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/code/api EnvironmentFile=__FINALPATH__/code/config/.env -# https://www.freedesktop.org/software/systemd/man/systemd.exec.html#RuntimeDirectory= -LogsDirectory=__APP__ +PermissionsStartOnly=true +ExecStartPre=/bin/mkdir -p /var/log/__APP__ +ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__ ExecStart=__FINALPATH__/code/virtualenv/bin/daphne -b ${FUNKWHALE_API_IP} -p ${FUNKWHALE_API_PORT} config.asgi:application --proxy-headers \ - --loglevel INFO --logfile=/var/log/__APP__/server.log + --verbosity 1 --access-log=/var/log/__APP__/server.log NoNewPrivileges=true PrivateDevices=true @@ -22,7 +23,7 @@ ProtectSystem=strict ProtectControlGroups=yes ProtectKernelModules=yes ReadOnlyPaths=__FINALPATH__/code/config/.env __FINALPATH__/code/ -ReadWritePaths=__FINALPATH__/media __FINALPATH__/import +ReadWritePaths=__FINALPATH__/media __FINALPATH__/import /var/log/__APP__ StandardOutput=syslog StandardError=syslog diff --git a/conf/funkwhale-worker.service b/conf/funkwhale-worker.service index cddd114..f641ba0 100644 --- a/conf/funkwhale-worker.service +++ b/conf/funkwhale-worker.service @@ -9,8 +9,9 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/code/api EnvironmentFile=__FINALPATH__/code/config/.env -# https://www.freedesktop.org/software/systemd/man/systemd.exec.html#RuntimeDirectory= -LogsDirectory=__APP__ +PermissionsStartOnly=true +ExecStartPre=/bin/mkdir -p /var/log/__APP__ +ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__ ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp worker -l INFO \ --loglevel INFO --logfile=/var/log/__APP__/worker.log @@ -22,7 +23,7 @@ ProtectSystem=strict ProtectControlGroups=yes ProtectKernelModules=yes ReadOnlyPaths=__FINALPATH__/code/config/.env __FINALPATH__/code/ -ReadWritePaths=__FINALPATH__/media __FINALPATH__/import +ReadWritePaths=__FINALPATH__/media __FINALPATH__/import /var/log/__APP__ StandardOutput=syslog StandardError=syslog