TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Two versions of commands.json on Pi 4

    General Discussion
    2
    2
    142
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      meetb
      last edited by

      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.

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @meetb
        last edited by

        @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.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • First post
          Last post