Triggers disappearing
-
Hello,
I have a strange issue. I have 19 triggers in my commands.json file, however when I go to run a trigger it will run, but when if I try to run it again several triggers will drop off from the webgui. They will remain in commands.json, and if I vi the file and just write quit it (without and changes) they'll come back until the next time I try to run it more than 1x.
I don't see any indication of an issue in syslog or journalctl.
I'm running debian 10.4 on a Raspberry Pi 3 Model B Rev 1.2.
Thanks,
Jeff -
@jpe81, I wonder if you have two agents running with the same token and computer id.
You might have the background agent running as root, with data in /root/.TRIGGERcmdData, and you're also running it as your own user, with data in /home/(user)/.TRIGGERcmdData
The two agents probably have different sets of commands in commands.json, and they're both over-writing the command list on the computer in your account.
That's my theory.
-
I only see one version running.
root@piAppServer:/# ps -ef | grep -i trigger
nobody 343 1 0 Aug21 ? 00:00:00 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event*
root 2363 1 0 05:39 ? 00:00:15 node /usr/share/triggercmdagent/app/src/daemon.js --run /root/.TRIGGERcmdData
root 3388 3249 0 09:39 pts/0 00:00:00 grep -i trigger
root@piAppServer:/#I did a find on commnads.json and it only returned the original and the .backup.
-
@jpe81, is it the same sub-set of triggers that remain every time some triggers drop off?
Also, please confirm - the triggers remain in the web gui until you run one of your commands, correct?
I wonder if there's another computer running with that computer id. You could try this experiment: Stop the triggercmdagent service on your Pi, and run one of the remaining triggers in the web gui. If you see Command ran in the Runs list, that would confirm there's another computer running with that computer ID, which would explain why the triggers keep changing.
-
I think you are right...there was an old pi that I moved everything from that didn't realize was on. That has to be it.
Thanks for all your help!
While I was looking at this I was considering moving it off the pi to docker. I saw that you used ubuntu, will this work with alpine as well?
Thanks again,
Jeff -
@jpe81, for Docker, these posts might be useful to you:
https://www.triggercmd.com/forum/topic/780/how-to-reduce-size-by-removing-dubious-dependencies/4
https://www.triggercmd.com/forum/topic/451/run-the-triggercmd-linux-agent-in-a-docker-containerIt should work fine on Alpine Linux. The agent.js script really just needs NodeJS to run.