• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

command pm2 start or stop mm

Instructions
2
6
1.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    ccd
    last edited by Oct 13, 2019, 2:29 PM

    Re: Raspberry Pi setup

    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

    R 1 Reply Last reply Oct 14, 2019, 3:02 PM Reply Quote 0
    • R
      Russ @ccd
      last edited by Oct 14, 2019, 3:02 PM

      @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.

      Russell VanderMey

      C 1 Reply Last reply Oct 15, 2019, 5:14 PM Reply Quote 0
      • C
        ccd
        last edited by Oct 15, 2019, 11:18 AM

        Hello russ,

        I will try this. Thanks for response 🙂

        1 Reply Last reply Reply Quote 0
        • C
          ccd @Russ
          last edited by Oct 15, 2019, 5:14 PM

          @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 beginner

          thanks

          1 Reply Last reply Reply Quote 0
          • C
            ccd
            last edited by Oct 15, 2019, 5:23 PM

            it's ok with sudo before...thanks again 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂

            R 1 Reply Last reply Oct 16, 2019, 12:55 AM Reply Quote 0
            • R
              Russ @ccd
              last edited by Oct 16, 2019, 12:55 AM

              @ccd, awesome, I'm glad you got it working. Sounds like this is the command that worked:

              su - pi -c 'pm2 start mm'
              

              Russell VanderMey

              1 Reply Last reply Reply Quote 0
              4 out of 6
              • First post
                4/6
                Last post