Process Managers
This documentation site is deprecated. Please visit the README of https://github.com/synzen/MonitoRSS for hosting instructions.
Optionally use a process manager to keep the process running in the background (make sure you manually run it after setting up to resolve any issues before doing this):
systemd
Whatever other process manager you want
Be wary of your process manager(s) doing infinite restarts. This may lead to you being blocked or banned by Discord.
PM2 / Forever
npm install -g pm2ornpm install -g foreverin terminal.add
sudobefore npm if you have permission issues.
cd MonitoRSSassuming your folder is named MonitoRSSpm2 start bot.jsorforever start bot.js
Realtime Log Tracking
Use
pm2 listorforever listto show the process ID.pm2 logs processIDorforever logs processID -f- you'll now be shown a short recent history of the bot logs, and any further
Complete History/Logs of Bot
Use
pm2 show processID/forever listto show theout log path/logfilelocation.cat /my/location/<log name>.log. This is not realtime tracking.
Clearing History
pm2 flush/forever cleanlogs
Stopping the Bot
pm2 stop processID/forever stop processID
Restarting
pm2 restart processID/forever restart processID
systemd
(credited to Danpiel)
Create unit file in
/etc/systemd/system/discord-rss.servicewith contents
[Unit]
Description=Discord RSS bot
[Service]
WorkingDirectory=/opt/discord-rss/
ExecStart=/usr/bin/node /opt/discord-rss/server.js
Type=simple
Restart=on-failure
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=discord-rss
[Install]
WantedBy=multi-user.targetReload systemd to take new configuration
sudo systemctl daemon-reloadStart it with
sudo systemctl start discord-rssEnable autostart with
sudo systemctl enable discord-rssLogs can be checked with
sudo journalctl -fu discord-rss
Last updated
Was this helpful?