From e79a08e392f1a7614b6ba1cb6bc639d4727f2ab0 Mon Sep 17 00:00:00 2001 From: Jeremiah Boby Date: Wed, 6 Nov 2019 17:29:01 +0000 Subject: [PATCH] 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" --- changelog.d/3005.docs.rst | 1 + docs/autostart_systemd.rst | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 changelog.d/3005.docs.rst diff --git a/changelog.d/3005.docs.rst b/changelog.d/3005.docs.rst new file mode 100644 index 000000000..e08a0706d --- /dev/null +++ b/changelog.d/3005.docs.rst @@ -0,0 +1 @@ +Adds autostart documentation for Red users who installed it inside a virtual environment. diff --git a/docs/autostart_systemd.rst b/docs/autostart_systemd.rst index 1af55e478..29d404c44 100644 --- a/docs/autostart_systemd.rst +++ b/docs/autostart_systemd.rst @@ -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 + + 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