Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start bot on reboot Linux #28

Closed
Dirtbikes1 opened this issue Jan 23, 2021 · 4 comments
Closed

Start bot on reboot Linux #28

Dirtbikes1 opened this issue Jan 23, 2021 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@Dirtbikes1
Copy link

Dirtbikes1 commented Jan 23, 2021

Hi! I have this running on latest Ubuntu Desktop. Everything is working.

I was wondering if you could provide some instruction for using systemd to make this run on a reboot (without a user logged in). I am worried if my system reboots the bot is going to stop working.

I am a not a complete novice to Linux, but I am not an expert either. I see that I would need a .service file located in etc/systemd/system, but I am unsure exactly what to put in there.

P.S. Sending you some BTC right now for your trouble.

Thanks!

@fabston
Copy link
Owner

fabston commented Jan 24, 2021

Hi, glad its all working now and thanks the donation :).

You'd have two options to run the app in the background as well as on boot. Systemd and PM2. I personally prefer PM2.

You can find an installation setup guide here. It will install it as .deb - no need for npm.

When the installation finished go into your bot folder in your venv, and start the bot with the following command:

pm2 start main.py --name TV-Webhook-Bot

To auto start the bot on boot type:

pm2 startup & pm2 save

You can see the logs with pm2 log.

Hope that helps and let me know it anything is not working.

@fabston fabston added the help wanted Extra attention is needed label Jan 24, 2021
@Dirtbikes1
Copy link
Author

Awesome. I will try it now. Thanks.

@fabston fabston pinned this issue Jan 24, 2021
@Dirtbikes1
Copy link
Author

You are totally awesome man! Working perfect! I can now get my bots moved over to my own server instead of relying on somebody else. I will send you some more BTC soon! Thank you so much.

@fabston
Copy link
Owner

fabston commented Jan 24, 2021

Awesome, glad to hear that. Enjoy the bot!

@fabston fabston closed this as completed Jan 24, 2021
Repository owner locked as resolved and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants