I am working on setting up an automated deployment of an executable using the PIGPIO C bindings to a Pi Zero. I copy the executable to the pi (into a directory on pi
user's desktop) as expected, but when I try to run it, I get a permissions error:
initCheckPermitted:
+---------------------------------------------------------+
|Sorry, you don't have permission to run this program. |
|Try running as root, e.g. precede the command with sudo. |
+---------------------------------------------------------+
It seems this problem can be solved by setting the executable to be owned by root
and using a permission setting like 4775
. This seems to allow me to run the executable while logged in as pi
.
Unfortunately though, when I then copy a new version of the executable in, the ownership permissions stay the same, but the sticky bit is removed and I can no longer run the executable. It seems like the right answer would be "figure out how to run the executable when it's owned by pi
". Is this possible? Can I change something so PIGPIO can access the needed hardware without having to do weird things with the permissions?
This question seems to be a similar issue, but with PWM specifically. I see a gpio
group but pi
is already in that group. Is this question related or completely misleading me?