Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 667 Bytes

File metadata and controls

29 lines (24 loc) · 667 Bytes

PM2 bug workaround

PM2 doesn't support bun properly. Use the following workaround suggested by @ofmendez on a related GitHub issue:

Pretend node is bun (may be optional).

cd ~/.local/bin
ln -s `which bun` node

Start the app with PM2.

cd %OFF_ALARM_DIR%
pm2 start "bun src/index.ts" --name "off-alarm" --exp-backoff-restart-delay 10000

Save the PM2 process list.

pm2 save

Check the status of the process. Note the PID of the off-alarm process.

pm2 status

Check the process is indeed being run in bun.

ps -p $PID_OFF_ALARM -o args=