Two versions of commands.json on Pi 4
-
I now have two different versions of commands.json on my Pi 4. Owner pi and owner root. The systemctl status triggercmdData says its using the file owned by root. Sadly I am unable to edit the file owned root as it gets restored.
I would like to use only one recommended place for managing commands.json. Pls. advise.
And to my surprise, how could it manage to create two separate versions.
-
@meetb, the commands.json file gets created in the home folder of the user who runs the agent.
On a Raspberry Pi I generally run the background service (daemon) as root because I'm dedicating the Pi to be a garage door opener, PiHole, or using it to wake up my PC. So I use /root/TRIGGERcmdData/commands.json and all of my commands have ground = background.
It's possible though that you might want to run X-Windows on your Pi and run the agent in foreground mode as pi, in which case you'd use the commands.json in pi's home folder.
Your commands.json file will be restored if the agent detects a problem in the json format, like a comma on the last entry, or if you forget to escape a quote or backslash. It restores the last valid commands.json file it had.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login