-
-
Notifications
You must be signed in to change notification settings - Fork 80
Running the bot on Linux
You will be running your bot using pm2
. It is a daemon process manager that will help you manage and keep your application online 24/7.
You can learn more about it here.
PM2 needs to be globally installed on your system, to do that type and run these commands:
sudo npm install -g pm2
You will also want to have your PM2 boot-up whenever you restart your server (assuming you've followed the instructions on the initial setup of your new VPS here).
sudo env PATH=$PATH:/usr/bin PM2_HOME=/home/ubuntu/.pm2 pm2 startup ubuntu -u ubuntu
sudo chown ubuntu:ubuntu -R /home/ubuntu/
Or if your username is not ubuntu
, replace <username>
to whatever your username is:
sudo env PATH=$PATH:/usr/bin PM2_HOME=/home/<username>/.pm2 pm2 startup ubuntu -u <username>
sudo chown <username>:<username> -R /home/<username>/
- Navigate to the
tf2autobot
folder
cd <path of your tf2autobot folder> // Example: cd tf2autobot
- Start the bot with pm2, load your current environment file, and save the changes you made
pm2 start ecosystem.json && pm2 save
To restart your bot after you changed your environment file you will have to tell pm2 to update its environment variables
Make sure you are inside your tf2autobot
folder and type
pm2 restart ecosystem.json --update-env && pm2 save
-
pm2 kill
- forced stop -
pm2 log
- to see bot’s logs -
pm2 list
- list of pm2 processes -
pm2 stop all
- stop all processes
-
pm2 restart ecosystem.json --update-env && pm2 save
- (re)start all bots and apply all changes -
pm2 restart ecosystem.json --only processName
- (re)start and apply only changes toprocessName
-
pm2 stop processName
- stopprocessName
-
pm2 restart ecosystem.json --update-env && pm2 save
- (re)start all bots and apply all changes -
pm2 restart ecosystem.json --only processName
- (re)start and apply only changes toprocessName
-
pm2 stop all
- stop all running bots
No matter if you are running one or multiple bots, it is recommended to do pm2 restart ecosystem.json --update-env && pm2 save && pm2 logs
to see if there are any problems after you change something in your environment file.
- Getting a VPS
- Downloading the bot
- Configuring the bot
- Running the bot (node and PM2)
- Introduction to pricelist
- Parameters
- Manage pricelist
- Other commands