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

    Ubuntu Linux agent instructions

    Linux
    6
    21
    8.7k
    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.
    • RussR
      Russ @pirates
      last edited by Russ

      @pirates, to avoid that problem, copy the ubuntupackage.json file to package.json before you run npm install. I'll update the steps above with that. It looks like the default package.json was the Windows version.

      Russell VanderMey

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Russ
        last edited by

        @Russ I have this installed and functional on a Debian 10 Raspberry Pi. The default commands work great, as well as a custom one that triggers a bash script that sends a WOL command to my PC.

        Question for you: Does triggercmd run the script as root, or as the user with elevated privileges via sudo?

        RussR 1 Reply Last reply Reply Quote 0
        • RussR
          Russ @A Former User
          last edited by

          @Tim-Manochehri, it runs them as root. If you run this command you'll see that the agent runs as root, and the agent runs the commands:

          ps -ef | grep triggercmdagent
          

          Russell VanderMey

          1 Reply Last reply Reply Quote 0
          • Daniel MachínD
            Daniel Machín
            last edited by

            Hi,

            I have followed the instructions in a headless Ubuntu, getting some errors:

            dpkg: error al procesar el paquete triggercmdagent (--install):
            installed triggercmdagent package post-installation script subprocess returned error exit status 127

            Triggercmd is installed but now, every time I try to apt upgrade it tries to reinstall triggercmd...

            Is this the normal behaviour?

            RussR 1 Reply Last reply Reply Quote 0
            • RussR
              Russ @Daniel Machín
              last edited by Russ

              @Daniel-Machín, that's not normal. I'd like to try to reproduce that problem and fix it. Can you tell me the commands you ran, and which specific operating system you installed it on? You wrote "headless" so I understand you did not install X-Windows on it.

              Russell VanderMey

              1 Reply Last reply Reply Quote 0
              • Daniel MachínD
                Daniel Machín
                last edited by Daniel Machín

                Hi Russ,

                Thanks for your reply!

                System is an Ubuntu 18.04.5 LTS (bionic) without X-Windows

                Anyway, I finally managed to make it work. Issue was dependencies:

                apt install npm
                

                solved the problem

                Perhaps, including npm as a dependency within .deb package could solve potential future issues (currently, only nodejs is a dependency):

                daniel@servidor:~$ sudo apt-cache depends triggercmdagent
                triggercmdagent
                  Depende: nodejs
                

                Thanks!
                Daniel

                RussR 1 Reply Last reply Reply Quote 0
                • RussR
                  Russ @Daniel Machín
                  last edited by

                  Thanks @Daniel-Machín. Good call. I'll add that.

                  https://github.com/rvmey/TRIGGERcmd-Agent/blob/master/ubuntupackage.json#L52

                  Russell VanderMey

                  P 1 Reply Last reply Reply Quote 0
                  • P
                    Pr0k0 @Russ
                    last edited by

                    @Russ One question does the agent automatically open in Linux at startup like windows? Because every time I boot I need to open it manually and it does not start up automatically. I followed the installation steps above, uninstalled, installed again but the same problem.... in windows and raspberry it is working fine with no issues... Do i need to install with no UI in Linux like raspberry??

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

                      @Pr0k0, the foreground Linux agents do not run automatically in X-Windows. I researched it but couldn't find a standard way to do that. If you install the background service, that will start during boot, but you'll need to make set the "ground" field in your commands.json file to "background" instead of "foreground" because the background agent adds/removes/runs background commands.

                      Russell VanderMey

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        Pr0k0 @Russ
                        last edited by

                        @Russ thnx for the reply, i understand, i tried to make a .sh file to execute the application in a cronjob when boot but it does not start......i cannot understand why, if execute manually the sh file starts normally, i also tried to create a service with some name pointing to the file.....service is active but again in boot, it does not start... the problem is because in the foreground i can make routines and not need to say the computer name everytime....that's why the foreground is helpful...the background service is not visible in the Home Skills so i cannot make a routine. Anyway thanks again for the reply.

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

                          @Pr0k0, background commands should show up as Alexa Smart Home devices, just like foreground commands, so I wonder if you didn't install the background service yet. This command should it:

                          sudo sh /usr/lib/triggercmdagent/resources/app/src/installdaemon.sh
                          

                          Russell VanderMey

                          1 Reply Last reply Reply Quote 0
                          • tuicemenT tuicemen moved this topic from Instructions on
                          • tuicemenT tuicemen pinned this topic on
                          • RussR Russ referenced this topic on
                          • Neidson de OliveiraN Neidson de Oliveira referenced this topic on
                          • RussR Russ referenced this topic on
                          • First post
                            Last post