-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute without sudo #680
Comments
No, as the hardware needs to be initialized, which only works as root. However, by default the library will switch back the user to a safe default after the initialization, so the root-exposure is short. If you can't run with sudo, you might try setuid root the binary. |
I tried use C lang create a unix socket server and use Golang send package to C , it only C part need root , and it worked : ) |
I upload my C lang server and Golang client here : ) https://gist.github.com/JokerCatz/b39143861480ef174069bc5c718b142c |
There is a solution, I just implemented it. First open /dev/gpiomem instead of /dev/mem, now you can run without root privileges. Second thing that requires root is changing the priority level of the scheduler. For this you can simply do |
On Sat, 8 Jun 2019 at 17:39, boilerbots ***@***.***> wrote:
There is a solution, I just implemented it.
First open /dev/gpiomem instead of /dev/mem, now you can run without root
privileges.
Does it work also with the other parts needed to do hardware pulse output ?
Second thing that requires root is changing the priority level of the
scheduler. For this you can simply do sudo setcap 'cap_sys_nice=eip' $@ in
the makefile after the final linking.
… —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#680?email_source=notifications&email_token=AABCNCOLYWC2G6J7T5DKIZ3PZRGNHA5CNFSM4FPNDEZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXIBGFY#issuecomment-500175639>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCNCJR5OACCY5AWMXUYELPZRGNHANCNFSM4FPNDEZA>
.
|
Good question, I am running with --led-no-hardware-pulse because I am trying to preserve the audio. I suspect it won't but I haven't looked into that. |
Hi,
Thanks for this awsome library.
I would like to know if there is a way to run binary without sudo-ing ?
The text was updated successfully, but these errors were encountered: