From a729a474b167fb7c581fb7c7ac7d0cccca27a128 Mon Sep 17 00:00:00 2001 From: Kowlin Date: Mon, 4 Nov 2019 22:52:01 +0100 Subject: [PATCH] Added documentation for PM2 (#2105) * Added PM2 documentation * Grammar fix * Build error fix. * Just work T_T * Update docs/autostart_pm2.rst Co-Authored-By: Vexed <51716387+Vexed01@users.noreply.github.com> * Update docs/autostart_pm2.rst Co-Authored-By: Vexed <51716387+Vexed01@users.noreply.github.com> * Create 2105.docs.rst --- changelog.d/2105.docs.rst | 1 + docs/autostart_pm2.rst | 42 +++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + 3 files changed, 44 insertions(+) create mode 100644 changelog.d/2105.docs.rst create mode 100644 docs/autostart_pm2.rst diff --git a/changelog.d/2105.docs.rst b/changelog.d/2105.docs.rst new file mode 100644 index 000000000..12b75c1d2 --- /dev/null +++ b/changelog.d/2105.docs.rst @@ -0,0 +1 @@ +Added documentation for PM2 support. diff --git a/docs/autostart_pm2.rst b/docs/autostart_pm2.rst new file mode 100644 index 000000000..b7e28e38d --- /dev/null +++ b/docs/autostart_pm2.rst @@ -0,0 +1,42 @@ +.. pm2 service guide + +============================================== +Setting up auto-restart using pm2 on Linux +============================================== + +.. note:: This guide is for setting up PM2 on a Linux environment. This guide assumes that you already have a working Red instance. + +-------------- +Installing PM2 +-------------- + +Start by installing Node.JS and NPM via your favorite package distributor. From there run the following command: + +:code:`npm install pm2 -g` + +After PM2 is installed, run the following command to enable your Red instance to be managed by PM2. Replace the brackets with the required information. +You can add additional Red based arguments after the instance, such as :code:`--dev`. + +:code:`pm2 start redbot --name "" --interpreter "" -- --no-prompt` + +.. code-block:: none + + Arguments to replace. + + --name "" + A name to identify the bot within pm2, this is not your Red instance. + + --interpreter "" + The location of your Python interpreter, to find out where that is use the following command: + which python3.6 + + + The name of your Red instance. + +------------------------------ +Ensuring that PM2 stays online +------------------------------ + +To make sure that PM2 stays online and persistence between machine restarts, run the following commands: + +:code:`pm2 save` & :code:`pm2 startup` diff --git a/docs/index.rst b/docs/index.rst index bcec8b9f2..85c3f217e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,6 +16,7 @@ Welcome to Red - Discord Bot's documentation! install_linux_mac venv_guide autostart_systemd + autostart_pm2 .. toctree:: :maxdepth: 2