Read the statement by Michael Teeuw here.
Starting mirror with PM2 on boot
-
@eitan ok let’s check mm first
cd ~/MagicMirror npm start
does it start?
if not show me the message from the terminal windowthose freedesktop messages are junk.
-
Thank you for your replay.
Yes, Magic Mirror starts with npm start,
It also starts with PM2, when running it after boot - pm2 start mm.
what I have not been able to do is for it to start automatically after boot. -
@eitan ok, I have not used the install instructions for pm2,
as I have an install script that does all the work ,you can use the fixuppm2 script
it uses a different mm.sh, whcih we ship, in the MagicMirror/installers folderyou will have to delete one of the entries from pm2 after this so you don’t try to start 2.
see
pm2 --help
for the command syntax
-
Hi sdetweil (as I don’t have your name),
Thank you, this worked perfect.
I ran the script, afterwards PM2 had a second line in it named MagicMirror.
I deleted my own mm line (PM2 delete mm) and was left with only MagicMirror in PM2
Stopped started the MagicMirror with PM2 and got an warning from PM2 about the incorrect mm:
[PM2][WARN] Current process list is not synchronized with saved list. App mm differs. Type ‘pm2 save’ to synchronize.
Saved the new status PM2 save
Rebooted the Pi and MagicMirror was up after boot.I was wondering if you can share the content of MagicMirror.sh (if it is an .sh script), so that I can understand what’s the different
In any case, thank you
-
@eitan my name is in each of my replies.
the script is ~/MagicMirror/installers/mm.sh
you can also give pm2 a json file with a more descriptive name.
see the file I create
~/MagicMirror/installers/pm2_magicmirror.jsonsee pm2 --help for all the things it can do
by convention, each command is to provide help 2 ways.
one in response to the only Parm --help and some usage man(ual) page(s)
so
man pm2
will.open that for pm2
-