application.executeProgram in Linux as 'sudo'

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

application.executeProgram in Linux as 'sudo'

Postby gerardo.gomez » Thu Jul 29, 2010 9:04 am

Hi!

I'm using this code in Linux (Ubuntu 10.04) to open files:

Code: Select all
application.executeProgram('gnome-open', vFullFileName)


This code is working properly with images, OpenOffice files, ... However, if I try to open a .pdf file (I have Adobe Reader 9 installed), I get this error:

"Adobe Reader does not need to be run as a privileged user. Please remove 'sudo' from the beginning of the command."


I found out Servoy is executing this command as "super user" (sudo) always... it isn't? If yes, exists some way to execute programs without executing as sudo???

Thanks in advance!
Best regards/Un saludo,

Gerardo Gómez
--
Servoy 5.1.4 build 964
Win7 - Java 1.6.0_20
Ubuntu 10.04 - Java 1.6.0_20
gerardo.gomez
 
Posts: 79
Joined: Thu Aug 20, 2009 1:15 am

Re: application.executeProgram in Linux as 'sudo'

Postby jcompagner » Thu Jul 29, 2010 9:49 am

Servoy isnt doing that, we are not doing anything special for linux or what ever os. We just call:

Code: Select all
Process myProcess = Runtime.getRuntime().exec(cmdArgsArray, envArgsArray, startDir);


with exactly the stuff you give us.

So do you run the main process (do you test this in developer?) as root/super user?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: application.executeProgram in Linux as 'sudo'

Postby gerardo.gomez » Thu Jul 29, 2010 10:49 am

jcompagner wrote:Servoy isnt doing that, we are not doing anything special for linux or what ever os. We just call:

Code: Select all
Process myProcess = Runtime.getRuntime().exec(cmdArgsArray, envArgsArray, startDir);


with exactly the stuff you give us.

So do you run the main process (do you test this in developer?) as root/super user?


Thanks Johan! It's just what was happening!

From Developer I get the error because Developer is executed as super user... And against a server, I was launching from a browser executed as super user too... :oops:
Best regards/Un saludo,

Gerardo Gómez
--
Servoy 5.1.4 build 964
Win7 - Java 1.6.0_20
Ubuntu 10.04 - Java 1.6.0_20
gerardo.gomez
 
Posts: 79
Joined: Thu Aug 20, 2009 1:15 am


Return to How To

Who is online

Users browsing this forum: No registered users and 5 guests