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

    Ubuntu: Installed the agent, ran "triggercmdagent", what next?

    Linux
    2
    6
    2.0k
    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.
    • ?
      A Former User
      last edited by A Former User

      I installed the deb (version 1.0.1) from the homepage, ran "triggercmdagent" and entered the token, and the computer is showing up in the account.

      But:

      • There is no icon in the tray
      • I found the file "~/.TRIGGERcmdData/commands.json", and it lists several commands, only one of which shows up on https://www.triggercmd.com/user/command/list?computer_id=...
      • I have not found any instructions for adding new commands/triggers.

      How does this work?

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

        @knipknap, on a Linux box you'll probably want to install it as a service/daemon. That will make the commands with ground=background show up in your account. Background means those commands run in the contexts of the background service.

        If you're not getting the icon, you can use this command to install the background service:

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

        What Linux OS are you using? I'd like to try to troubleshoot that icon issue if I can.

        Russell VanderMey

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

          @Russ Thanks for the info. Then I am guessing it has to do with a path mismatch:

          sam@desky:~$ sudo sh /usr/share/triggercmdagent/resources/app/src/installdaemon.sh
          sh: 0: Can't open /usr/share/triggercmdagent/resources/app/src/installdaemon.sh
          

          I found the file here, but it seems to have /usr/share hardcoded:

          sam@desky:~$ sudo sh /usr/lib/triggercmdagent/resources/app/src/installdaemon.sh
          find: ‘/usr/share/triggercmdagent’: No such file or directory
          Failed to enable unit: Unit file triggercmdagent.service does not exist.
          Unit triggercmdagent.service could not be found.
          

          System info:

          sam@desky:~$ lsb_release -a
          LSB Version:	core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
          Distributor ID:	Ubuntu
          Description:	Ubuntu 18.04.1 LTS
          Release:	18.04
          Codename:	bionic
          
          sam@desky:~$ ps -ef | grep triggercm
          sam      21492 21329  0 08:12 pts/0    00:00:00 grep --color=auto triggercm
          sam      24093  1628  0 Dez19 ?        00:02:14 /usr/lib/triggercmdagent/triggercmdagent
          sam      24096 24093  0 Dez19 ?        00:00:00 /usr/lib/triggercmdagent/triggercmdagent --type=zygote --no-sandbox
          sam      24129 24093  0 Dez19 ?        00:00:03 /usr/lib/triggercmdagent/triggercmdagent --type=gpu-process --no-sandbox --gpu-preferences=KAAAAAAAAACAAACAAQAAAAAAAAAAAGAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAA --service-request-channel-token=...
          sam      24131 24096  0 Dez19 ?        00:00:01 /usr/lib/triggercmdagent/triggercmdagent --type=renderer --no-sandbox --service-pipe-token=4FE14E7388B5C138861C0F676ECFBD1D --lang=en-US --app-path=/usr/lib/triggercmdagent/resources/app --node-integration=true --webview-tag=true --no-sandbox --background-color=#fff --num-raster-threads=2 --enable-main-frame-before-activation --enable-compositor-image-animations --service-request-channel-token=... --renderer-client-id=6 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
          

          I can actually trigger the "Gnome Editor" default command and it works.

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

            @knipknap, thanks for showing me that path mismatch. I'll need to somehow make that path variable depending on the Linux flavor so you can install the background service on Ubuntu 18.

            You're able to trigger Gnome Editor because it's a foreground trigger, and the agent is running in foreground mode. You'll see that in commands.json.

            EDIT: I updated the GUI deb version of the agent, and confirmed it works on Ubuntu 18.04 and 18.10.

            I found that my TRIGGERcmd tray icon showed up when I ran triggercmdagent, and inputted my token.

            I fixed that path issue so it will work whether the path is /usr/lib/... or /usr/share/....

            I installed the background service and my background commands worked.

            Please give it a try. Again thanks for reporting the bug.

            Russell VanderMey

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

              @Russ partial success :-). I deleted the old .deb, installed the new one (are you sure that the link is correct? Because the version number is unchanged.), deleted the computer from https://www.triggercmd.com/user/computer/list and did the following:

              $ triggercmdagent 
              (electron) The 'lstatSyncNoException' function has been deprecated and marked for removal.
              (electron) 'app.makeSingleInstance(cb)' is deprecated. Use 'app.requestSingleInstanceLock() and app.on('second-instance', cb)' instead.
              No token exists.  Login to request one.
              Attempting to log in with token xxx
              handleSubmission token xxx
              Token saved for next time.
              You must subscribe before adding another computer.
              Attempting to log in with token xxx
              handleSubmission token xxx
              Token saved for next time.
              Tokenfile: /home/sam/.TRIGGERcmdData/token.tkn
              ComputerIDfile: /home/sam/.TRIGGERcmdData/computerid.cfg
              Logging in with saved token to run foreground tasks.
              Computer ID xxx saved for next time.
              Write backup completed.
              Initiated command removals
              Initiated command adds
              
              
                |>    Now connected to https://www.triggercmd.com.
              \___/   For help, see: http://bit.ly/2q0QDpf
                      (using sails.io.js node SDK @v1.2.1)
                       Connected at: Fri Dec 21 2018 20:40:38 GMT+0100 (CET)
              
              
              
              { message: 'Subscribed to xxx!' }
              { message: 'Subscribed to xxx!' }
              Added Gnome Editor
              

              ...and the computer is online again, but no icon in the panel.

              But installation of the background agent works now! 🙂

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

                @knipknap, nice! That's progress.

                I'm not sure why the icon isn't showing. Can you think of anything that's not standard about your xwindows install? It show up for me and I took defaults when I installed Ubuntu Desktop v18

                For now you can use some other editor to edit commands.json.

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • tuicemenT tuicemen moved this topic from Instructions on
                • First post
                  Last post