gksudo and logname issues

86 Views Asked by At

We have a Java Swing cross platform application,which we are packaging into a deb file and installing it in the user's system. This application, upon it's start-up checks for the new version and installs it, if it finds any. At present for installing the new version, we are calling sudo dpkg -i XXX.deb " in a gnome-terminal from java using Runtime.exec().

I have tried to modify the sudo to gksudo, so there wont be need to open the gnome terminal to enter the user's password. The problem I am facing now is the installation script is not working properly by doing so, it is saying it cannot find logname(i.e current user's username, so that we can cleanup old files and install new ones in his home directory) , but when I do the same with sudo I am not getting any error. They wont let me change the script, as it is not big enhancement, but I am asking this out of curiosity why different behavior is observed with sudo and gksudo

0

There are 0 best solutions below