[Gambas-user] run project as root

Ru Vuott vuott at ...325...
Sun Sep 23 14:00:08 CEST 2012


> Can you provide a working example how to use

 Desktop.RunAsRoot("cat /dev/ttyUSB1")



...but Ihad a problem:
I tried function Desktop.RunAsRoot(), but I heve got this notice:

/tmp/gambas.1000/3328/xdg-utils/xdg-su: 361: /tmp/gambas.1000/3328/xdg-utils/xdg-su: xterm: not found


So, I changed this line:

     xterm -geom 60x5 -T "xdg-su: $cmd" -e su -c "$cmd" "$user"

in "su_generic()" routine of the script: /tmp/gambas.1000/3328/xdg-utils/xdg-su

with this new line:

     /usr/bin/x-terminal-emulator -e su -c "$cmd" "$user"

and so it worked.


But it's possible to use this simple command line in code Gambas:

Shell "/usr/bin/x-terminal-emulator -e su -c \"here_the_entire_command\" \"$user\""

it substitutes Desktop.RunAsRoot() function.

regards

Vuott





--- Dom 23/9/12, wally <wally at ...2037...> ha scritto:

> Da: wally <wally at ...2037...>
> Oggetto: Re: [Gambas-user] run project as root
> A: Gambas-user at lists.sourceforge.net
> Data: Domenica 23 settembre 2012, 10:10
> Hello Jussi,
> 
> i 've seen in other postingsyou mentioned tests using 
> 
> "Desktop.RunAsRoot("whoami")"
> Can you provide a working example how to use
> Desktop.RunAsRoot, please ?
> (e.g. how to get the returned usersname)
>   
> thx wally
> 
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list