Linux Server - No GUI - Add Background commands

  • administrators

    @laakness, I see. Your commands.json file will get over-written if it has bad json formatting in it. That's why I like the GUI because it handles the json formatting for you.

    One common mistake that can mess up json is having a comma at the end of the last record.

    If you copy/paste your json data here (before it gets over-written) I could probably spot the problem.

    Or, you could use to check your json.

  • @russ you are the man.

    That was it, I was missing a comma. You'd think after working with kubernetes and yaml files all week I would have run it through a format validator :)

    Nice work on this app btw.

  • administrators

    Thanks @laakness. I'm learning Kubernetes myself.

    I made this video showing it off:

  • This not only runs the process in background, also generates a log (called .... You put a command in the background by adding & after the command: ... bad connection to the server

  • administrators

    @asussupport, please clarify. Are you getting an error?

  • How do I run a program in the background of a shell, with the ability to close the shell while leaving the program running? Lets say my UI is having problems or for some reason, I need to boot up a program from the terminal window???

  • administrators

    @asussupport, take a look at the screen program. That might be what you're looking for. Otherwise, please tell me more about what you're trying to accomplish.

  • Hi, I run into the same problem today. I tried to edit the file named linuxcommands.json, it is under /usr/lib/triggercmdagent/resources/app/src. I added a command, but I am not seeing it on my command list. Here is my file:
    {"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":"touch file","command":"echo "haha" > /home/fhcat/triggercmd.file","ground":"background","voice":"touch file","allowParams": "false"}

  • administrators

    @fhcat9, that's the wrong file to edit. That's just the list of default commands. That linuxcommands.json file gets copied to ~/.TRIGGERcmdData/commands.json when you start the agent for the first time.

    You want to be editing your ~/.TRIGGERcmdData/commands.json file instead.

  • @russ Thanks! Now I can begin customize my commands on my OrangePi. BTW, the Ubuntu instructions probably needs some update. I installed the latest Non-Gui package and some of my steps are different. For example, for me, the agent directory is /usr/lib/triggercmdagent/resources/app/src/agent.js, not /usr/share/triggercmdagent/resources/app/src/agent.js. And on my Ubuntu 16.04, it is nodejs /usr/lib/triggercmdagent/resources/app/src/agent.js --console as node is deprecated.

Log in to reply

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.