Add autostart documentation for venv users (#3028)

* Add documentation for venv users

Resolves #3005

* Add changes to changelog.d

* Use "redenv" over "path/to/venv"
This commit is contained in:
Jeremiah Boby 2019-11-06 17:29:01 +00:00 committed by Michael H
parent 7e9b1b87e6
commit e79a08e392
2 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1 @@
Adds autostart documentation for Red users who installed it inside a virtual environment.

View File

@ -8,11 +8,23 @@ Setting up auto-restart using systemd on Linux
Creating the service file
-------------------------
Create the new service file:
In order to create the service file, you will first need the location of your :code:`redbot` binary.
.. code-block:: bash
# If redbot is installed in a virtualenv
source redenv/bin/activate
# If you are using pyenv
pyenv shell <name>
which redbot
Then create the new service file:
:code:`sudo -e /etc/systemd/system/red@.service`
Paste the following and replace all instances of :code:`username` with the username your bot is running under (hopefully not root):
Paste the following and replace all instances of :code:`username` with the username, and :code:`path` with the location you obtained above:
.. code-block:: none
@ -21,7 +33,7 @@ Paste the following and replace all instances of :code:`username` with the usern
After=multi-user.target
[Service]
ExecStart=/home/username/.local/bin/redbot %I --no-prompt
ExecStart=path %I --no-prompt
User=username
Group=username
Type=idle