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

How do you load Triggercmd on boot on Ubuntu?

Linux
4
11
982
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.
  • S
    Sid Boswell
    last edited by Apr 16, 2020, 4:54 PM

    Any way I can automagically load the triggercmd on boot on Ubuntu?

    Just /usr/lib/triggercmdagent/triggercmdagent in Startup Applications or are there an parameters needed?

    Thanks,
    sid.

    R 1 Reply Last reply Apr 17, 2020, 1:38 PM Reply Quote 0
    • R
      Russ @Sid Boswell
      last edited by Apr 17, 2020, 1:38 PM

      @Sid-Boswell, no parameters are needed to run the agent in foreground mode. It will find what it needs in your ~/.TRIGGERcmdData directory.

      You can install the agent to startup in background mode during boot by running the installdaemon.sh script with sudo.

      Please look at this page for more details.

      Russell VanderMey

      A 1 Reply Last reply Aug 16, 2023, 10:41 PM Reply Quote 0
      • T tuicemen moved this topic from Instructions on Jan 31, 2022, 12:35 PM
      • A
        Avishai Algrisi @Russ
        last edited by Avishai Algrisi Aug 16, 2023, 10:41 PM Aug 16, 2023, 10:41 PM

        @Russ
        Hey,

        I'm using ubuntu container on QNAP when running the .sh it says the following:

        avishai@ubuntu:~$ sudo /usr/share/triggercmdagent/app/src/installdaemon.sh
        node[680]: pthread_create: Invalid argument
        Daemon install: true
        Logging in with saved token.
        Checking if the 64dd4da843f3df001afa9817 computer exists.
        This computer exists in your account.
        System has not been booted with systemd as init system (PID 1). Can't operate.
        System has not been booted with systemd as init system (PID 1). Can't operate.
        Configuration file /etc/systemd/system/triggercmdagent.service is marked executable. Please remove executable permission bits. Proceeding anyway.
        Created symlink /etc/systemd/system/default.target.wants/triggercmdagent.service → /etc/systemd/system/triggercmdagent.service.
        System has not been booted with systemd as init system (PID 1). Can't operate.

        R 1 Reply Last reply Aug 16, 2023, 11:26 PM Reply Quote 0
        • R
          Russ @Avishai Algrisi
          last edited by Russ Aug 17, 2023, 2:22 AM Aug 16, 2023, 11:26 PM

          @Avishai-Algrisi, thanks for showing me this. I see a bug. I'll update it soon.

          EDIT: Actually, I wasn't able to reproduce your error, but I think you're installing the backgroud agent but you probably don't need to.

          You can run the agent like this:

          node /usr/share/triggercmdagent/app/src/agent.js --console
          

          You could also try this image witht the agent built in:
          https://hub.docker.com/r/rvmey/triggercmdagent

          Russell VanderMey

          A 1 Reply Last reply Aug 20, 2023, 10:10 PM Reply Quote 1
          • A
            Avishai Algrisi @Russ
            last edited by Avishai Algrisi Aug 20, 2023, 10:16 PM Aug 20, 2023, 10:10 PM

            @Russ
            Hey Russ,

            Thank you for replying.
            The docker container works, forgot to mention I'm with arm processor.

            one more thing please if you can, I had this problem in the past but I don't remember what I did that it worked.

            After adding the token, the container register in the website successfully but it shows only "Gnome Editor" while my "/root/.TRIGGERcmdData/commands.json" looks like this:

            # find / -iname commands.json
            /root/.TRIGGERcmdData/commands.json
            # cat /root/.TRIGGERcmdData/commands.json
            [
              {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
              {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"edit","allowParams": "false"},
              {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
              {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"},
              {"trigger":"startpc","command":"etherwake -i eth0 B4:2E:99:A1:DF:CB","ground":"background","voice":"startpc","allowParams":"false"}
            ]
            #
            

            All I care here of course is the last one 🙂

            R 1 Reply Last reply Aug 21, 2023, 12:07 AM Reply Quote 0
            • R
              Russ @Avishai Algrisi
              last edited by Russ Aug 21, 2023, 12:09 AM Aug 21, 2023, 12:07 AM

              @Avishai-Algrisi, good question. You're running the agent in foreground mode, which is fine, but it's ignoring all of the commands on your commands.json with "ground":"background". That's why you only see the Gnome Editor command - it's a foreground command. Change the ground setting on your startpc command to foreground, and it should work.

              Russell VanderMey

              A 1 Reply Last reply Aug 22, 2023, 10:00 AM Reply Quote 1
              • A
                Avishai Algrisi @Russ
                last edited by Aug 22, 2023, 10:00 AM

                @Russ I love you. ❤️

                R 1 Reply Last reply Aug 22, 2023, 12:00 PM Reply Quote 0
                • R
                  Russ @Avishai Algrisi
                  last edited by Aug 22, 2023, 12:00 PM

                  😊 Thanks @Avishai-Algrisi

                  Russell VanderMey

                  B 1 Reply Last reply Apr 1, 2024, 1:30 PM Reply Quote 0
                  • B
                    Brunera EL @Russ
                    last edited by Brunera EL Apr 1, 2024, 1:35 PM Apr 1, 2024, 1:30 PM

                    @Russ Hi, first I would like to thank you for all support!

                    I'm trying to load Triggercmd right after boot on Linux Mint 21.3 Cinnamon.

                    Here is my current setup:
                    Triggercmd is already working with Alexa with only one trigger configured ( to shutdown my machine) but for it to work, then I first need to put my PC credentials and wait for desktop to load, then command works...

                    I was wondering if it is possible to load Triggercmd right after boot so I don't have to login on linux mint for commands to work...

                    FYI - I have triggercmdagent.service active (running) and already installed Background service (via Install background service option) on linux mint tray

                    thanks!!

                    R 1 Reply Last reply Apr 1, 2024, 8:21 PM Reply Quote 0
                    • R
                      Russ @Brunera EL
                      last edited by Apr 1, 2024, 8:21 PM

                      @Brunera-EL, one of the advantages of the background service is it runs before you login. It also runs background commands as root on Linux.

                      If you create a background command, does it show up on the website? If so, that means the background service is working. Please try changing the ground setting on your shutdown command to background, and try running it before you login. It should work.

                      a17be917-a761-4877-8acd-a6122d48df94-image.png

                      Russell VanderMey

                      B 1 Reply Last reply Apr 2, 2024, 2:00 AM Reply Quote 0
                      • B
                        Brunera EL @Russ
                        last edited by Apr 2, 2024, 2:00 AM

                        @Russ Hi Russ! I have created new commands for testing purposes but only the ones that are marked as "foreground" were showing up on the website... So I used the option "remove background services" and then "install background services" and right after that the background commands appeared on website.... Not sure what happened, maybe something was stuck and cleared by itself after the reinstall...anyway, it's working properly now!! Thank you for all quick support, really appreciate that!
                        Best regards

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post