Setting up Auto-Restart (Linux)
Ways to setup auto restart for your bot on Linux hosts.
sudo apt install npm -y && sudo npm i pm2 -gsudo dnf -y install npm && sudo npm i pm2 -gpm2 start modmail.sh --name "modmail"pm2 logs modmailpm2 save && pm2 startuppm2 restart modmail
pm2 reload modmail
pm2 stop modmail
pm2 delete modmail
pm2 list
``` </div>
<div data-gb-custom-block data-tag="tab" data-title='systemd (Setting up Modmail as a Linux Service)'> `systemd` is a built-in service manager for most Linux systems. It's primary used to manage background applications and services and to make applications auto-restart on crash and run on system startup.
We will be using `systemd` for Modmail by making a service file for our bot.
In order to create the service file, you will first need to know three things, your Linux `username`, your Modmail folder location as `modmail_path` and your Pipenv location as `pipenv_path`.
First, your Linux `username` can be fetched with the following command:
```bash
whoamiLast updated