Background Daemon Install Errors
-
Running Linux Mint, I wanted to have everything ready to go when I booted, so assumed I needed to have the background daemon running. I checked with "systemctl status triggercmdagent" and got this msg:
● triggercmdagent.service - TRIGGERcmd Agent
Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Wed 2021-06-16 13:44:27 MST; 7min ago
Process: 1906 ExecStart=/usr/bin/env node /usr/lib/triggercmdagent/resources/app/src/daemon.js --run /root/.TRIGGERcmdData (code=exited, status=0/SUCCESS)
Main PID: 1906 (code=exited, status=0/SUCCESS)Jun 16 13:44:27 main systemd[1]: triggercmdagent.service: Scheduled restart job, restart counter is at 5.
Jun 16 13:44:27 main systemd[1]: Stopped TRIGGERcmd Agent.
Jun 16 13:44:27 main systemd[1]: triggercmdagent.service: Start request repeated too quickly.
Jun 16 13:44:27 main systemd[1]: triggercmdagent.service: Failed with result 'start-limit-hit'.
Jun 16 13:44:27 main systemd[1]: Failed to start TRIGGERcmd Agent.I then assumed I needed to run "installdaemon.sh". That appeared to run and install ok, but now I have two "main" computers in my computer list. Doesn't look right, LoL.
I am really just trying to get triggercmdagent ready and willing to roll when I boot the PC w/o heading to the CLI and messing around. Do I need to start over, or is this salvageable?
Great program but it is taking me a bit to get my head wrapped around how it works!
Thanks,
Monty
-
@Monty, sorry for the delay. I had company tonight.
I think you've installed the background agent to run as root, and use /root/.TRIGGERcmdData as its data directory. You could send me the debug.log from that directory and I might see a clue, but you could also probably fix it with these steps:
- Delete the computer records from your account.
- Switch user to root with: sudo su -
- Delete the /root/.TRIGGERcmdData directory with: rm -rf /root/.TRIGGERcmdData
- Run triggercmdagent and enter your token
- Restart the triggercmdagent service with: systemctl restart triggercmdagent
At that point you'll probably have a new computer record in your account, and you'll be able to run background commands by adding them to your /root/.TRIGGERcmdData/commands.json file. Just make sure you set ground = background because the triggercmdagent daemon is running in background mode.
If you run triggercmdagent as your non-root user in X-Windows, it will create a second computer account associated with your /home/(user)/.TRIGGERcmdData directory.
Also fyi, I didn't create a way to automatically start the agent in foreground mode on Linux. If you figure out a simple way to do that, let me know please.
-
Well, everything seems to be working! If something is missing, I haven't run across it yet, despite those error messages. I can boot my computer and when everything is done starting, I can say "Alexa, run Sling TV" and up it pops in a Chromium (Linux) window; which was what I wanted. I haven't tried to find things that don't work yet, as I am enjoying those that do!
As to running automatically, I simply added a command in the Linux Mint "Startup Applications" list with a 25 second delay:
triggercmdagent
That puts an icon on my status panel. If I right click it, I have options for:
TriggerCMD.com Background Service Start Background Service Remove Background Service Text Command Editor GUI Command Editor QuitI have not done anything with those two Background Service controls as things appear to be working as I want them to.
Thanks for the great support!
Monty
-
Awesome @Monty, I'm glad you got it working.