command pm2 start or stop mm
-
hello,
very nice to use this application...but i can't use my command pm2 start mm and pm2 stop mm...i have a raspebrry pi3 with magicmirror..in a terminal with pi@raspberrypi i can work with pm2 start or stop mm to display magicmirror...How can i writte with the command trigger?
{"trigger":"start mm","command":"pm2 start mm","ground":"background","voice":"magic on","allowParams": "false"},
{"trigger":"stop mm","command":"pm2 stop mm":"background","voice":"magic off","allowParams": "false"},a sudo reboot in the command is ok
thanks for help
-
@ccd, your triggercmdagent daemon is running as root, but I think you want that pm2 command to run as pi, so please try changing your command to this:
su - pi -c 'pm2 start mm'That su command will run as root, then it will run the pm2 command as the pi user.
-
Hello russ,
I will try this. Thanks for response

-
@Russ
my command pm2 start (or stop) is working in "pi@raspberrypi $ pm2 start mm"
the command with : "su - pi -c 'pm2 start mm'" doesn 't work..sorry i am a beginnerthanks
-
it's ok with sudo before...thanks again

-
@ccd, awesome, I'm glad you got it working. Sounds like this is the command that worked:
su - pi -c 'pm2 start mm'
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