Read the statement by Michael Teeuw here.
PM2 MM2 Not starting on start up
-
BINGO Got it to work. Not sure if others had a problem with this or its something new. but here it is.
However, there is a bug on the generated startup script that prevents PM2 from automatically run at startup. You will need to edit /etc/init.d/pm2-init.sh and
replace: export PM2_HOME=“/root/.pm2”
with: export PM2_HOME=“/home/pi/.pm2”Got this from here: https://bekti.io/automatically-start-a-node-js-application-on-raspberry-pi/
-
Hey,I’m having this exact same issue. I’m trying to follow your steps but I can’t locate the pm2-init.sh file. I have the pm2 installed. I go follow the same directory paths as stated but that one file isn’t there. Any ideas about where the file is? It has to exist somewhere since I’m able to use it.
-
@sebzx10r Its directory is /etc/init.d/pm2-init.sh
-
@sebzx10r The way i did it also is used WinSCP to shh in to raspberry.
-
-
Hey,yes, I go to that same exact directory,but the file isn’t there. And yes I can load MM with pm2 start mm.sh. That’s what so weird about the whole thing. It’s as if the file doesn’t exist but yet the program is working somehow.
-
Hey,I kind of did a work around. I found this on another forum:
I also searched for days without success but then, I got it to work quite simply.In Raspian click Menu,Preferences,Main Menu Editor
Click Preferences and check Default applications for LXSession
Click OK and close main menu editor
Now click Menu and Under Preferences click on Default applications for LXSession
LXSession configuration opens
Click Autostart
Under Manual autostarted applications paste in your java command line
click add
close the LXSession configuration application and reboot your pi
your java app should run after reboot -
@sebzx10r What line did you put in the field? I can’t get it to work.
-
@nuckinfutz
pm2 start mm.sh -
I solved the same issue by using the command:
sudo pm2 startup systemd -u pi --hp /home/piAnd then using
pm2 saveto save the state. -
@shbatm
will note that down thanks! -
@Desertswing No idea what that did but it worked, just need to make it show the weather as that seems to have gone away
-
Try here as an alternative
https://forum.magicmirror.builders/topic/2716/pm2-alternative
-
@shbatm said in PM2 MM2 Not starting on start up:
sudo pm2 startup systemd -u pi --hp /home/pi
Can also confirm this worked for me, too.
Thank you @shbatm
-
-
@pum there is an existing script provided by MagicMirror now, please try deleting everything on your ~/.pm2 directory, then using:
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi" pm2 start ~/MagicMirror/installers/pm2_MagicMirror.json pm2 saveYou may have to use
systemdinstead oflinuxin the first line if you get an error. -
@shbatm I did all I should follow but it still doesn’t work for me, I’m using Rpi4b. It warning me:
PM2 is not managing any process, skipping save…
Plz help me my boyfriend’s birthday is under eyes!!
Thanks a lot!
-
@MarvellousMili run the fixuppm2.sh script from here
-
@sdetweil sorry that reply late, I save the pm2 status after reboot again and again then work. I don’t know where’s the problem even now lol
-
@MarvellousMili sorry. not sure what u said
is working ok
or
is NOT working ok
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login