vasani-arpit / WBOT

A simple Web based BOT for WhatsApp™ in NodeJS 😜. Working as of 📅 Feb 4th, 2024
Other
990 stars 314 forks source link

The bot stops after closing the terminal in vps ubuntu #185

Closed mohamed-hmd closed 4 years ago

mohamed-hmd commented 4 years ago

Describe the bug I have a problem I am currently running the bot on vps ubuntu, but after closing the terminal, the bot stops working. What is the solution please.

lucasvmx commented 4 years ago

Describe the bug I have a problem I am currently running the bot on vps ubuntu, but after closing the terminal, the bot stops working. What is the solution please.

Have you tried to use as a service?

run sudo su before running commands below

echo -e "[Unit]\nDescription=WBOT service\n[Service]\nType=simple\nExecStart=/PATH/TO/WBOT/EXECUTABLE\n[Install]\nWantedBy=multi-user.target" > /etc/systemd/system/wbot.service
systemctl daemon-reload
systemctl start wbot # execute wbot in background
journalctl -e -u wbot

the last command is to see the QR code

vasani-arpit commented 4 years ago

As this is a node project you can also use process managers like Pm2 or forever to keep the process running.

FirePing32 commented 4 years ago

@mohamed-hmd This can only happen when you run the bot by SSHing into VPS and running it through that terminal. As you close SSH connection, terminal also closes. Install GUI for Ubuntu and then open terminal.

vasani-arpit commented 4 years ago

Reopen if needed.