[Gambas-user] Strange problem with running Shell on Fedora (code works in IDE but not in executable!!)
Benoît Minisini
gambas at ...1...
Sat Mar 30 13:30:56 CET 2013
Le 30/03/2013 13:14, Tobias Boege a écrit :
>>
>> SHELL "a b c" ...
>>
>> is equivalent to:
>>
>> EXEC [ System.Shell, "-c", "a b c" ]
>>
>> with a call to setpgid(0,0) to create its own session like an
>> independant shell.
>>
>> As for virtual terminal creation, they work both the same.
>>
>> - "For Input Output" => create a virtual terminal for the i/o of the
>> child process, and get the i/o of the child process through it.
>>
>> - "For Read Write" => Just redirect the i/o of the child process to get
>> them in the parent process.
>>
>> Can you try to replace "SHELL ..." by "EXEC [ System.Shell, "-c", ... ]"
>> and tell me if it works better?
>>
>
> Exec [System.Shell, "-c", "sudo -s id -u"] For Input Output
>
> It works!
>
> Regards,
> Tobi
>
So is it the setpgid() call that prevents sudo from finding the virtual
terminal? Strange...
--
Benoît Minisini
More information about the User
mailing list