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

    command pm2 start or stop mm

    Scheduled Pinned Locked Moved Instructions
    6 Posts 2 Posters 2.7k Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          ccd
          last edited by

          Hello russ,

          I will try this. Thanks for response 🙂

          1 Reply Last reply Reply Quote 0
          • C Offline
            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 Offline
              ccd
              last edited by

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

              RussR 1 Reply Last reply Reply Quote 0
              • RussR Offline
                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

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