SatukanCinta v3 is in maintenance mode. It is in a Lightsail VM, run directly as Spring Boot 1.5 app using Byobu and shell script. Due to unresolved problem with persistent session storage, it needs restarting every approximately 6 hours. We’re now managing it using pm2.
- Install NodeJS 16
- Install yarn
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm -g i yarn
Edit ~/.bashrc
export PATH="$PATH:$HOME/.yarn/bin"
Install PM2 (in ubuntu user)
yarn global add pm2
Using PM2 to manage SatukanCinta v3 app runtime
Start SatukanCinta v3 then tail logs:
cd ~/satukancinta1
pm2 start scintad.sh
pm2 logs
Restarting SatukanCinta v3: (use another byobu tab)
pm2 restart scintad
Restarting SatukanCinta v3 using crontab:
# This will restart at 7am WIB, 13pm WIB, 19pm WIB, and 1am WIB
0 0,6,12,18 * * * /home/ubuntu/.yarn/bin/pm2 restart scintad