Refactor environment variables and update systemd service configuration for ANewDawn
This commit is contained in:
parent
80e0637e8a
commit
195ca21947
7 changed files with 70 additions and 97 deletions
28
systemd/anewdawn.service
Normal file
28
systemd/anewdawn.service
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[Unit]
|
||||
Description=ANewDawn Discord Bot
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# Run the bot as the lovinator user (UID 1000) so it has appropriate permissions.
|
||||
# Update these values if you need a different system user/group.
|
||||
User=lovinator
|
||||
Group=lovinator
|
||||
|
||||
# The project directory containing main.py (update as needed).
|
||||
WorkingDirectory=/home/lovinator/Code/ANewDawn
|
||||
|
||||
# Load environment variables (see systemd/anewdawn.env.example).
|
||||
EnvironmentFile=/etc/ANewDawn/ANewDawn.env
|
||||
|
||||
# Use the python interpreter from your environment (system python is fine if dependencies are installed).
|
||||
ExecStart=/usr/bin/env python3 main.py
|
||||
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue