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

    command pm2 start or stop mm

    Instructions
    2
    6
    1.3k
    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

      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

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @ccd
        last edited by

        @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 Reply Quote 0
        • C
          ccd
          last edited by

          Hello russ,

          I will try this. Thanks for response 🙂

          1 Reply Last reply Reply Quote 0
          • C
            ccd @Russ
            last edited by

            @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

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

              RussR 1 Reply Last reply Reply Quote 0
              • RussR
                Russ @ccd
                last edited by

                @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
                • First post
                  Last post