How to use pm2 startup command on Mac?
Asked Answered
B

1

6

My question is the same as How to use pm2 startup command on Debian platform? but i need to make it start on Mac OS (darwin)

I only found a very bref documentation $ pm2 startup <ubuntu|centos|gentoo|systemd>

What can I do?

Blader answered 30/10, 2014 at 22:15 Comment(1)
Told you there that you should have a look at launchd. Put a pm2.plist file in /Library/LaunchDaemons with the right informations.Hued
K
6

PM2 now has darwin option for startup, so running:

pm2 startup darwin 

should work.

Also checkout this commit: 1. Make platform auto detecting. 2. Support darwin startup script. So right now, you can just call:

pm2 startup

and the script will recognise your OS.

NOTE: I'm currently having issues on Yosemite as the launchd gives me an error. You can find more info (and solution that works for me) here: darwin startup script fix on yosemite #989

Also if you can test it in your environment and support this pull request, it would be great:)

Kandicekandinsky answered 2/2, 2015 at 19:9 Comment(3)
i find it rather disturbing that either of those commands gives me a command to run which starts sudo su -c but that gives me the error su: illegal option -- cOestriol
MAC os Sierra. I just installed node i pm2. When I try any command that involves PM2 I get bash: pm2: command not foundKronos
@VedranMaricevic. I haven't checked the pm2 for a while, because I moved to docker. But this looks like you don't have the pm2 installed (or at least the binary is not in the right place - maybe checking the $PATH could help)Kandicekandinsky

© 2022 - 2024 — McMap. All rights reserved.