Setcap not working with Electron - need to use sudo
See original GitHub issueHi, I’m using bleno in an electron app and have followed all the steps for installation.
I launch my application using electron main.js
As such I have run this step:
sudo setcap cap_net_raw+eip $(eval readlink -f `which electron`)
However I still get the error suggesting I run it with sudo. It works fine when I run it with sudo but it messes with other things in my application. I’ve applied the above step to both electron and node both which are on my path. Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Where is the local node.js from the electron framework located?
Since this isn't a good solution for production use, I tried the official command sudo setcap cap_net_raw+eip $(eval readlink -fwhich node) but ...
Read more >Run Electron without GUI - Stack Overflow
I have an Electron based Web Server. It's meant for beginning web developers, students, and artists that are not used to the command...
Read more >setcap not working with Proton : r/SteamPlay - Reddit
I'm trying to run Battlefield 4 with proton but I have the no ping bug. Basically, the game doesn't detect my ping and...
Read more >Controlling smart devices via BLE. Electron and React Native.
Using regular Bluetooth was not an option, because we don't need to ... To work with the native modules in the renderer, the...
Read more >Tor - ArchWiki - Arch Linux
If your computer is not running a web server, and you have not set ... so to use those, Tor must be run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s correct that you need to set the permissions on the electron executable, but this is probably the local electron executable since this is the one you will package and ship. Also you need to add the packaged libnode.so to the dynamic linker in linux because the node version might differ from system to system or might not be installed at all.
This is what I did: sudo setcap cap_net_raw+eip ./node_modules/electron/dist/electron and than adding the absolute path to the dist directory to a new config file “electron-node.conf” in /etc/ld.so.conf.d/ after that I reloaded the linker with sudo ldconfig.
@AnthonyMyatt thanks for the answer in https://github.com/sandeepmistry/bleno/issues/282#issuecomment-334100845.