leledumbo wrote:
How can one control the GPIO outputs on a Raspberry Pi2 without needing the
program to run as root?

sudo chown root <program name>
sudo chmod 4755 <program name>

The 4 is setuid bit, which will allow normal users to run the program but
the program itself has root privilege.

With the caveat that running setuid root is incompatible with at least some versions of GTL, it's necessary to use Qt instead.

"The unix way" for this would be to have a driver that exposes the GPIO pins somewhere in /dev, with appropriate group ownership to which select users could be added.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to