I have a java application that has a timer that executes a separate application that requires elevated privileges. I have been doing this:
String command = "gksudo /home/bob/sensor";
Process child = Runtime.getRuntime().exec(command);
The problem is that every time the timer kicks off, it requests the password, so I get it every two seconds. Is there a way to only request the password once and then stay elevated so that as long as the java application is running it won't ask again?
I tried using gconf-editor to change the apps/gksu/save-to-keyring option, but that didn't change anything, and I think it might be a nuclear option anyway.