Important
Many thanks to Neuro for the initial project and for this detailed documentation!
Automatic Startup (systemctl)
Warning
This guide is for Linux only. There’s is no auto-restart system for Windows or Mac at the moment.
Warning
If you plan to run this with multiple bots, you will need to add the flags you normally add to the ExecStart line. Additionally, if you have multiple systemctl files for the dashboard, you will need to rename them.
Creating the service file
In order to create the service file, you will first need to know two things, your Linux username and your Python path.
First, your Linux username can be fetched with the following command:
whoami
Next, your python path can be fetched with the following commands:
# If reddash is installed in a venv.
source ~/reddashenv/bin/activate
which python
# If reddash is installed in a pyenv virtualenv.
pyenv shell <virtualenv_name>
pyenv which python
Then create the new service file:
sudo -e /etc/systemd/system/reddash.service
Replace path with your python path and username with your Linux username.
[Unit]
Description=Red-Web-Dashboard
After=multi-user.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=path -O -m reddash
User=username
Group=username
Type=idle
Restart=always
RestartSec=15
RestartPreventExitStatus=0
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target
Save your file and exit: ctrl + O; enter; ctrl + x
Now you can start the webserver by using:
# Start Dashboard.
sudo systemctl start reddash
# Stop Dashboard.
sudo systemctl stop reddash
Automatic startup on system bootup
To automatically start the webserver at system’s bootup, use the following command:
# Enable automatic startup.
sudo systemctl enable reddash
# Disable automatic startup.
sudo systemctl disable reddash
Check logs
To check Dashboard’s logs, use:
sudo journalctl -eu reddash
Tip
You can use the --following flag to see live logs, to check if there’s any trouble while using the Dashboard.