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'