Can not start cmavnode or dflogger

I have been working on installing some of the packages that are used in apsync, to setup a custom solution for my companion computer. I am running into problems trying to get cmavnod and dflogger started automatically. I have another sd card flashed with apsync and besides keeping the default username as “pi” for now and not using network manager to keep things simple for now I keep getting a permission error when trying to start either cmavnod or dflogger.

The output i get is:
pi@arducc:~/start_cmavnode $ sudo -H -u pi /bin/bash -c ‘/home/pi/start_cmavnode/autostart_cmavnode.sh’

  • cd /home/pi/start_cmavnode
  • sudo screen -L -d -m -S cmavnode -s /bin/bash ./start_cmavnode.sh
    /home/pi/start_cmavnode/autostart_cmavnode.sh: line 7: start_cmavnode.log: Permission denied

i understand that it the script autostart_cmavnode.sh needs superuser privelages but also needs the normal users home directory which is that what sudo -H -u pi is for… however this elevated privelage as far as i can understand does not get passed to when the output “>start_cmavnode.log”. I thought thats what /bin/bash -c did was pass the elevated privelage to the remaining commands in the script. If anyone has any advice I would greatly appreciate it. I do not understand why it works on the apsync image and not my setup.