@Russ
the restart and status check worked!
I used apt for the removal and node update.
Thanks again for your help!
@Russ
the restart and status check worked!
I used apt for the removal and node update.
Thanks again for your help!
I'm wanting to use this to restart mysqld using ifttt on a server that does NOT have a GUI.
All the docs I'm reviewing state to launch a GUI to create the command.
Nothing like that in the TriggerCMD interface.
Take a look at this AI generated result from Google Search:
https://www.google.com/search?q=how+to+trigger+a+mysql+restart+on+ubuntu+using+ifttt&oq=how+to+trigger+a+mysql+restart+on+ubuntu+using+ifttt&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQLhhA0gEJMjIwMzdqMGoxqAIAsAIA&sourceid=chrome&ie=UTF-8
@Russ
the restart and status check worked!
I used apt for the removal and node update.
Thanks again for your help!
@Russ
Well I did as you suggesteed:
The server was seen in the TriggerCMD web console.\
However, when I ran systemctl status triggercmdagent, shows failure and the server is disconnected from the console.
Notice too the error thrown before I issued the status command.
Here's the code:
root@twilight2:~# rm -rf ~/.TRIGGERcmdData
root@twilight2:~# node /usr/lib/triggercmdagent/resources/app/src/agent.js --console
Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
Daemon install: false
No token exists. Login to request one.
prompt: token: [hidden]
Token saved for next time.
Tokenfile: /root/.TRIGGERcmdData/token.tkn
ComputerIDfile: /root/.TRIGGERcmdData/computerid.cfg
Logging in with saved token to run foreground tasks.
Local Home Assistant Configuration file not found at /root/.TRIGGERcmdData/home_assistant_config.json
Local Home Assistant listener is disabled.
Computer ID [hidden] saved for next time.
Write backup completed.
|> 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: Thu Apr 10 2025 15:01:01 GMT-0500 (Central Daylight Time)
Initiated command removals
Computer name for Local Home Assistant listener: null
Error fetching computer name: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received null
at Object.writeFile (node:fs:2311:5)
at /usr/lib/triggercmdagent/resources/app/src/ha.js:120:10
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
{ message: 'Subscribed to 67f8237d3395ce0013c3aef0!' }
{ message: 'Subscribed to 67f8237d3395ce0013c3aef0!' }
Initiated command adds
Added Calculator
Added Gnome Editor
^C
root@twilight2:~# systemctl status triggercmdagent
× triggercmdagent.service - TRIGGERcmd Agent
Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2025-04-08 11:33:38 CDT; 2 days ago
Main PID: 604516 (code=exited, status=1/FAILURE)
CPU: 455ms
Apr 08 11:33:38 twilight2 systemd[1]: triggercmdagent.service: Scheduled restart job, restart count>
Apr 08 11:33:38 twilight2 systemd[1]: Stopped TRIGGERcmd Agent.
Apr 08 11:33:38 twilight2 systemd[1]: triggercmdagent.service: Start request repeated too quickly.
Apr 08 11:33:38 twilight2 systemd[1]: triggercmdagent.service: Failed with result 'exit-code'.
Apr 08 11:33:38 twilight2 systemd[1]: Failed to start TRIGGERcmd Agent.
root@twilight2:~#
@Russ Thanks for your update.
Did as you prescribed.
Threw an error "can't find module 'fs/promises'"
restarted triggercmdagent
but then when I check status states that service has failed.
Here's the complete sequence:
root@twilight2:~# node /usr/lib/triggercmdagent/resources/app/src/agent.js --console
Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
Daemon install: false
Logging in with saved token.
Checking if the null computer exists.
This computer was deleted from your account. Login to recreate it.
prompt: token: [hidden]
Token saved for next time.
Tokenfile: /root/.TRIGGERcmdData/token.tkn
ComputerIDfile: /root/.TRIGGERcmdData/computerid.cfg
Logging in with saved token to run foreground tasks.
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'fs/promises'
Require stack:
- /usr/lib/triggercmdagent/resources/app/node_modules/chokidar/index.js
- /usr/lib/triggercmdagent/resources/app/src/agent.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:85:18)
at Object.<anonymous> (/usr/lib/triggercmdagent/resources/app/node_modules/chokidar/index.js:7:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/triggercmdagent/resources/app/node_modules/chokidar/index.js',
'/usr/lib/triggercmdagent/resources/app/src/agent.js'
]
}
root@twilight2:~# systemctl restart triggercmdagent
root@twilight2:~# systemctl status triggercmdagent
× triggercmdagent.service - TRIGGERcmd Agent
Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2025-04-08 11:33:38 CDT; 17s ago
Process: 604516 ExecStart=/usr/bin/env node /usr/lib/triggercmdagent/resources/app/src/daemon.j>
Main PID: 604516 (code=exited, status=1/FAILURE)
CPU: 455ms
Apr 08 11:33:38 twilight2 systemd[1]: triggercmdagent.service: Scheduled restart job, restart count>
Apr 08 11:33:38 twilight2 systemd[1]: Stopped TRIGGERcmd Agent.
Apr 08 11:33:38 twilight2 systemd[1]: triggercmdagent.service: Start request repeated too quickly.
Apr 08 11:33:38 twilight2 systemd[1]: triggercmdagent.service: Failed with result 'exit-code'.
Apr 08 11:33:38 twilight2 systemd[1]: Failed to start TRIGGERcmd Agent.
lines 1-12/12 (END)
This is a server, no GUI
Logged in as a user.
Installation is normal until the end:
N: Download is performed unsandboxed as root as file '/home/gigaboy/triggercmdagent_1.0.1_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
gigaboy@twilight2:~$
I'm user gigaboy, not "apt"
After this, there is no prompt for inserting the token.
Tried this twice, uninstalled, reinstalled, same problem.
If I run the installdaemon, I get this:
gigaboy@twilight2:~$ sudo sh /usr/lib/triggercmdagent/resources/app/src/installdaemon.sh
Daemon install: true
No token exists. Login to request one.
● triggercmdagent.service - TRIGGERcmd Agent
Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2025-04-07 06:23:23 CDT; 445ms ago
Main PID: 316544 (node)
Tasks: 7 (limit: 4562)
Memory: 23.7M
CPU: 283ms
CGroup: /system.slice/triggercmdagent.service
└─316544 node /usr/lib/triggercmdagent/resources/app/src/daemon.js --run /root/.TRIGGE>
Apr 07 06:23:23 twilight2 systemd[1]: Started TRIGGERcmd Agent.
Thanks for your help.