Commit 7f988e22 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

add systemd examples

parent cfe0e352
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
# Example systemd units

These are example service units for you to customize in your production setup.

- web.service is a base configuration for a gunicorn running the web app
- worker.service executes the background tasks
- cron.service registers the recurring tasks

You may have multiple copies of the worker.service to have multiple tasks workers.
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
[Unit]
Description=Jama Tasks Worker Service
After=remote-fs.target
[Service]
Type=idle
User=youruser
Group=youruser
UMask=007
ExecStart=/home/jama/jama_venv/bin/jama crontask --no-heartbeat
Environment="PATH=/home/youruser/Image-ExifTool-12.44/:/usr/bin/:/home/youruser/jama_venv/bin:$PATH"
Restart=always
RestartSec=5
TimeoutStopSec=10
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
[Unit]
Description=Jama Web Service
After=remote-fs.target
[Service]
Type=idle
User=youruser
Group=youruser
UMask=007
ExecStart=/home/youruser/jama_venv/bin/gunicorn --preload --log-level info --timeout 180 --max-requests 100 --max-requests-jitter 10 -b 127.0.0.1:8000 -w 12 jama.wsgi
Environment="PATH=/home/youruser/Image-ExifTool-12.44/:/usr/bin/:/home/youruser/jama_venv/bin:$PATH"
Restart=always
RestartSec=5
TimeoutStopSec=10
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
[Unit]
Description=Jama Tasks Worker Service
After=remote-fs.target
[Service]
Type=idle
User=youruser
Group=youruser
UMask=007
ExecStart=/home/jama/jama_venv/bin/jama db_worker
Environment="PATH=/home/youruser/Image-ExifTool-12.44/:/usr/bin/:/home/youruser/jama_venv/bin:$PATH"
Restart=always
RestartSec=5
TimeoutStopSec=10
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
 No newline at end of file