Reply to topic

What does "kdesu whatev" do with "whatev"s stderr ? [Solved]

User avatar aCOSwt
Registered Member
Posts
14
Karma
0
OS
Apart from eating it, I mean ???

- Using kdesu 4.9.5 and konsole 4.9.5
- If, under konsole, I launch whatever_binary, the content of whatever_binary's standard error is correctly printed.
- If, I launch kdesu whatever_binary then, konsole displays miscellaneous traces from kdesu but whatever_binary's stderr content is no longer displayed.

How can I get it back ?

Last edited by aCOSwt on Fri May 31, 2013 4:55 pm, edited 1 time in total.
User avatar bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you try passing the "-t" argument to kdesu?


KDE Sysadmin
[img]http://forum.kde.org/content/bcooksley_sig.png[/img]
User avatar google01103
Manager
Posts
6668
Karma
25

Fri May 31, 2013 12:58 pm
I don't think you can

supposedly the gtk command gksu, if available, will work

I don't understand why this works and I'm pretty sure in days of old it did not, if you can open a root tab in Konsole and you'll see output. not sure this would be considered good practices though.

Image


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar aCOSwt
Registered Member
Posts
14
Karma
0
OS
bcooksley wrote:Can you try passing the "-t" argument to kdesu?

Thanks bcooksley. That fits for purpose.

google01103 wrote:I don't understand why this works and I'm pretty sure in days of old it did not

That is because a child process inherits the stdin / stdout / stderr from its parent.
- su forks an interactive shell (stdin=keyboard / stdout = stderr = console) and then the commands you type are children of that shell. => unless you specifically redirect them, those file descriptors will be kept for the commands you type.
- With kdesu whatever_command, things appear a little more complicated. From what I can observe :
kdesu starts forking su kdesu_stub which in turns forks kdesu_stub which in turn forks whatever_command. :o
I suspect the stderr / stdout are closed by one of these cascaded children unless the t parameter is given.

Nevermind. Thank you all for your contributions.
User avatar bcooksley
Administrator
Posts
19765
Karma
87
OS
Not a problem.
You may also want to check the other arguments supported by "kdesu", by checking it's help: "kdesu --help".


KDE Sysadmin
[img]http://forum.kde.org/content/bcooksley_sig.png[/img]

 
Reply to topic

Bookmarks



Who is online

Registered users: adsbn, Baidu [Spider], beerislife, benita, Bing [Bot], gerdeg, Google [Bot], nettek, protonic, Shane15, Skrachen