2

I have an application that I downloaded from my class' website for our custom avr robot and it requires root privileges to send our binaries to the robot via usb.

When I try to use it with sudo, the terminal says that the program was not found, even if it is in my path (and is found when not using sudo).

I've seen that programs like muon and other software updaters use policykit to request for password only when needed, after the software is launched. By using this I could launch the app normally then I would be prompted for my password to allow it to do its things.

How can I actually add this to our application? I can't find any documentation for the policykit, I don't even know if it is supposed to be in the sources or tied to the binaries...

OliPro007
  • 123
  • Do you want to modify your applications source to use Polkit? – muru Apr 03 '16 at 01:18
  • what happens when you run sudo with the absolute path of the binary as the argument? – tlund Apr 03 '16 at 01:37
  • See https://askubuntu.com/questions/78352/when-to-use-pkexec-vs-gksu-gksudo and https://askubuntu.com/questions/287845/how-to-configure-pkexec – Takkat Apr 03 '16 at 06:59
  • @muru If this is how we add polkit then yes. – OliPro007 Apr 03 '16 at 20:13
  • @tlund It works with the absolute path, I was just wondering how polkit can be added to a program and I thought it could be a good situation to test it. – OliPro007 Apr 03 '16 at 20:13
  • @tlund: Could you please convert that to an answer so that schmucks like me who go around hunting for unanswered questions don't have to look at this one any more? ;-) (And I'll upvote if you drop me a note and it's a good one too!) – Fabby Apr 03 '16 at 23:43

1 Answers1

2

The binary might be in YOUR path but not in roots path. Try using an absolut path with sudo:

sudo /home/you/bin/some_binary
tlund
  • 155