example.service
· 366 B · SYSTEMD
Raw
[Unit]
Description=description of the service
After=network.target
[Service]
User=specific user for this service
Group=specific user for this service
WorkingDirectory=directory from which to run the service
Environment="PATH=/…/venv/bin" # if it’s being run in a venv
ExecStart=command to run the service
Restart=on-failure
[Install]
WantedBy=multi-user.target
| 1 | [Unit] |
| 2 | Description=description of the service |
| 3 | After=network.target |
| 4 | |
| 5 | [Service] |
| 6 | User=specific user for this service |
| 7 | Group=specific user for this service |
| 8 | WorkingDirectory=directory from which to run the service |
| 9 | Environment="PATH=/…/venv/bin" # if it’s being run in a venv |
| 10 | ExecStart=command to run the service |
| 11 | Restart=on-failure |
| 12 | |
| 13 | [Install] |
| 14 | WantedBy=multi-user.target |