2020-01-30 14:47:36 +01:00
|
|
|
[Unit]
|
|
|
|
Description=LibreTime API Service
|
2022-07-06 14:21:55 +02:00
|
|
|
Requires=libretime-api.socket
|
2022-05-08 19:20:03 +02:00
|
|
|
PartOf=libretime.target
|
2020-01-30 14:47:36 +01:00
|
|
|
|
|
|
|
[Service]
|
2022-09-27 11:51:17 +02:00
|
|
|
NoNewPrivileges=true
|
|
|
|
CapabilityBoundingSet=
|
|
|
|
PrivateDevices=true
|
2022-04-25 16:09:19 +02:00
|
|
|
PrivateTmp=true
|
2022-09-27 11:51:17 +02:00
|
|
|
PrivateUsers=true
|
|
|
|
ProtectClock=true
|
|
|
|
ProtectControlGroups=true
|
2022-09-27 13:17:43 +02:00
|
|
|
ProtectHostname=true
|
2022-09-27 11:51:17 +02:00
|
|
|
ProtectKernelLogs=true
|
|
|
|
ProtectKernelModules=true
|
|
|
|
ProtectKernelTunables=true
|
2022-09-27 13:17:43 +02:00
|
|
|
ProtectProc=invisible
|
2022-09-27 11:51:17 +02:00
|
|
|
ProtectSystem=full
|
2022-02-19 08:03:25 +01:00
|
|
|
|
2024-01-07 14:30:20 +01:00
|
|
|
Environment=PYTHONOPTIMIZE=2
|
2022-05-23 17:16:02 +02:00
|
|
|
Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
2022-09-27 11:51:17 +02:00
|
|
|
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/api.log
|
2022-01-15 18:22:24 +01:00
|
|
|
|
2022-09-27 11:51:17 +02:00
|
|
|
Type=notify
|
|
|
|
KillMode=mixed
|
2023-04-24 15:45:34 +02:00
|
|
|
ExecStart=@@VENV_DIR@@/bin/gunicorn \
|
2022-04-25 16:09:19 +02:00
|
|
|
--workers 4 \
|
2023-12-29 17:47:50 +01:00
|
|
|
--worker-class libretime_api.gunicorn.Worker \
|
2022-04-25 16:09:19 +02:00
|
|
|
--log-file - \
|
2022-07-06 14:21:55 +02:00
|
|
|
--bind unix:/run/libretime-api.sock \
|
2022-07-06 17:25:04 +02:00
|
|
|
libretime_api.asgi
|
2022-04-25 16:09:19 +02:00
|
|
|
ExecReload=/bin/kill -s HUP $MAINPID
|
2022-09-27 11:51:17 +02:00
|
|
|
Restart=always
|
|
|
|
|
2022-07-06 16:21:40 +02:00
|
|
|
User=libretime
|
|
|
|
Group=libretime
|
2020-01-30 14:47:36 +01:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|