public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] X programs as root
@ 2010-09-22 18:48 Andrey Vul
  2010-09-22 19:01 ` Volker Armin Hemmann
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Andrey Vul @ 2010-09-22 18:48 UTC (permalink / raw
  To: gentoo-user

When I launch X programs via sudo, I get the following:

$sudo gui-admin
No protocol specified
gui-admin: cannot connect to X server :0

( Assume gui-admin is an X program )

But (gk|kde)su(do)? works. This is somewhat confusing.


--
Andrey "m05hbear" Vul



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] X programs as root
  2010-09-22 18:48 [gentoo-user] X programs as root Andrey Vul
@ 2010-09-22 19:01 ` Volker Armin Hemmann
  2010-09-22 19:08 ` [gentoo-user] " Nikos Chantziaras
  2010-10-17 13:00 ` Nikos Chantziaras
  2 siblings, 0 replies; 23+ messages in thread
From: Volker Armin Hemmann @ 2010-09-22 19:01 UTC (permalink / raw
  To: gentoo-user

On Wednesday 22 September 2010, Andrey Vul wrote:
> When I launch X programs via sudo, I get the following:
> 
> $sudo gui-admin
> No protocol specified
> gui-admin: cannot connect to X server :0
> 
> ( Assume gui-admin is an X program )
> 
> But (gk|kde)su(do)? works. This is somewhat confusing.
> 
> 
> --
> Andrey "m05hbear" Vul

a) pam
b) sux



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-user] Re: X programs as root
  2010-09-22 18:48 [gentoo-user] X programs as root Andrey Vul
  2010-09-22 19:01 ` Volker Armin Hemmann
@ 2010-09-22 19:08 ` Nikos Chantziaras
  2010-09-23  1:18   ` Dale
  2010-10-17 13:00 ` Nikos Chantziaras
  2 siblings, 1 reply; 23+ messages in thread
From: Nikos Chantziaras @ 2010-09-22 19:08 UTC (permalink / raw
  To: gentoo-user

On 09/22/2010 09:48 PM, Andrey Vul wrote:
> When I launch X programs via sudo, I get the following:
>
> $sudo gui-admin
> No protocol specified
> gui-admin: cannot connect to X server :0
>
> ( Assume gui-admin is an X program )
>
> But (gk|kde)su(do)? works. This is somewhat confusing.

sudo doesn't keep the $DISPLAY environment variable by default.  There 
could be other issues too.  Best stick to kdesu and friends; that's what 
they are there for.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-22 19:08 ` [gentoo-user] " Nikos Chantziaras
@ 2010-09-23  1:18   ` Dale
  2010-09-24 22:24     ` Andrey Vul
  2010-09-24 23:35     ` Nikos Chantziaras
  0 siblings, 2 replies; 23+ messages in thread
From: Dale @ 2010-09-23  1:18 UTC (permalink / raw
  To: gentoo-user

Nikos Chantziaras wrote:
> On 09/22/2010 09:48 PM, Andrey Vul wrote:
>> When I launch X programs via sudo, I get the following:
>>
>> $sudo gui-admin
>> No protocol specified
>> gui-admin: cannot connect to X server :0
>>
>> ( Assume gui-admin is an X program )
>>
>> But (gk|kde)su(do)? works. This is somewhat confusing.
>
> sudo doesn't keep the $DISPLAY environment variable by default.  There 
> could be other issues too.  Best stick to kdesu and friends; that's 
> what they are there for.
>
>

Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work 
either.  It worked before but not now.  I'm not sure what changed 
between 4.4 and 4.5.1 but it broke my konqueror as root and other 
programs as well.  Still have some I haven't tried tho.  Konqueror is 
the one I need most.  Oh, I can get Dolphin to work tho.  The conspiracy 
theory part in me is starting to think.

Sure would like to get this working again too.

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-23  1:18   ` Dale
@ 2010-09-24 22:24     ` Andrey Vul
  2010-09-24 23:35     ` Nikos Chantziaras
  1 sibling, 0 replies; 23+ messages in thread
From: Andrey Vul @ 2010-09-24 22:24 UTC (permalink / raw
  To: gentoo-user

On Wed, Sep 22, 2010 at 21:18, Dale <rdalek1967@gmail.com> wrote:
> Nikos Chantziaras wrote:
>>
>> On 09/22/2010 09:48 PM, Andrey Vul wrote:
>>>
>>> When I launch X programs via sudo, I get the following:
>>>
>>> $sudo gui-admin
>>> No protocol specified
>>> gui-admin: cannot connect to X server :0
>>>
>>> ( Assume gui-admin is an X program )
>>>
>>> But (gk|kde)su(do)? works. This is somewhat confusing.
>>
>> sudo doesn't keep the $DISPLAY environment variable by default.  There
>> could be other issues too.  Best stick to kdesu and friends; that's what
>> they are there for.
>>

It's the "other issues".
>>
>
> Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
> either.  It worked before but not now.  I'm not sure what changed between
> 4.4 and 4.5.1 but it broke my konqueror as root and other programs as well.
>  Still have some I haven't tried tho.  Konqueror is the one I need most.
>  Oh, I can get Dolphin to work tho.  The conspiracy theory part in me is
> starting to think.

Same here, s/konqueror/every gui program run via sudo/
>
> Sure would like to get this working again too.
Ditto. VMware tools, etc, are all gui and sometimes sudo is eaiser to
use than kdesu.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-user] Re: X programs as root
  2010-09-23  1:18   ` Dale
  2010-09-24 22:24     ` Andrey Vul
@ 2010-09-24 23:35     ` Nikos Chantziaras
  2010-09-25  3:03       ` Dale
  2010-09-27 17:54       ` Helmut Jarausch
  1 sibling, 2 replies; 23+ messages in thread
From: Nikos Chantziaras @ 2010-09-24 23:35 UTC (permalink / raw
  To: gentoo-user

On 09/23/2010 04:18 AM, Dale wrote:
> Nikos Chantziaras wrote:
>> On 09/22/2010 09:48 PM, Andrey Vul wrote:
>>> When I launch X programs via sudo, I get the following:
>>>
>>> $sudo gui-admin
>>> No protocol specified
>>> gui-admin: cannot connect to X server :0
>>>
>>> ( Assume gui-admin is an X program )
>>>
>>> But (gk|kde)su(do)? works. This is somewhat confusing.
>>
>> sudo doesn't keep the $DISPLAY environment variable by default. There
>> could be other issues too. Best stick to kdesu and friends; that's
>> what they are there for.
>>
>>
>
> Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
> either. It worked before but not now. I'm not sure what changed between
> 4.4 and 4.5.1 but it broke my konqueror as root and other programs as
> well. Still have some I haven't tried tho. Konqueror is the one I need
> most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
> me is starting to think.
>
> Sure would like to get this working again too.

Again, use kdesu, not sudo.

But if some reason you want sudo, /etc/sudoers has some info:

   ## Run X applications through sudo

Read the comments there and uncomment what suits you.  Did I mention 
that you should use kdesu instead of sudo? :-P




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-24 23:35     ` Nikos Chantziaras
@ 2010-09-25  3:03       ` Dale
  2010-09-25  7:43         ` Volker Armin Hemmann
  2010-09-25  8:14         ` Yohan Pereira
  2010-09-27 17:54       ` Helmut Jarausch
  1 sibling, 2 replies; 23+ messages in thread
From: Dale @ 2010-09-25  3:03 UTC (permalink / raw
  To: gentoo-user

Nikos Chantziaras wrote:
> On 09/23/2010 04:18 AM, Dale wrote:
>> Nikos Chantziaras wrote:
>>> On 09/22/2010 09:48 PM, Andrey Vul wrote:
>>>> When I launch X programs via sudo, I get the following:
>>>>
>>>> $sudo gui-admin
>>>> No protocol specified
>>>> gui-admin: cannot connect to X server :0
>>>>
>>>> ( Assume gui-admin is an X program )
>>>>
>>>> But (gk|kde)su(do)? works. This is somewhat confusing.
>>>
>>> sudo doesn't keep the $DISPLAY environment variable by default. There
>>> could be other issues too. Best stick to kdesu and friends; that's
>>> what they are there for.
>>>
>>>
>>
>> Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
>> either. It worked before but not now. I'm not sure what changed between
>> 4.4 and 4.5.1 but it broke my konqueror as root and other programs as
>> well. Still have some I haven't tried tho. Konqueror is the one I need
>> most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
>> me is starting to think.
>>
>> Sure would like to get this working again too.
>
> Again, use kdesu, not sudo.
>
> But if some reason you want sudo, /etc/sudoers has some info:
>
>   ## Run X applications through sudo
>
> Read the comments there and uncomment what suits you.  Did I mention 
> that you should use kdesu instead of sudo? :-P
>
>

Well, I don't really know what it is using.  I just set up the menu item 
to run the program as root.  I don't know if it uses su -, kdesu, sudo 
or what.  I just know it worked until the upgrade a few days ago.

Since KDE proclaimed this was supposed to be ready for widespread use 
and cut off KDE3, I sure do wish they would make up their mind HOW 
things are going to work.  I would think they need to know that before 
claiming something was ready for widespread use.  Makes me want to go 
back to KDE 3.5.  At least I could get everything I need to work and 
survive a upgrade too.  ;-)

Oh well.  This is the new normal for KDE I guess.  lol

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25  3:03       ` Dale
@ 2010-09-25  7:43         ` Volker Armin Hemmann
  2010-09-25  9:09           ` Dale
  2010-09-25  8:14         ` Yohan Pereira
  1 sibling, 1 reply; 23+ messages in thread
From: Volker Armin Hemmann @ 2010-09-25  7:43 UTC (permalink / raw
  To: gentoo-user

On Saturday 25 September 2010, Dale wrote:
> Nikos Chantziaras wrote:
> > On 09/23/2010 04:18 AM, Dale wrote:
> >> Nikos Chantziaras wrote:
> >>> On 09/22/2010 09:48 PM, Andrey Vul wrote:
> >>>> When I launch X programs via sudo, I get the following:
> >>>> 
> >>>> $sudo gui-admin
> >>>> No protocol specified
> >>>> gui-admin: cannot connect to X server :0
> >>>> 
> >>>> ( Assume gui-admin is an X program )
> >>>> 
> >>>> But (gk|kde)su(do)? works. This is somewhat confusing.
> >>> 
> >>> sudo doesn't keep the $DISPLAY environment variable by default. There
> >>> could be other issues too. Best stick to kdesu and friends; that's
> >>> what they are there for.
> >> 
> >> Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
> >> either. It worked before but not now. I'm not sure what changed between
> >> 4.4 and 4.5.1 but it broke my konqueror as root and other programs as
> >> well. Still have some I haven't tried tho. Konqueror is the one I need
> >> most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
> >> me is starting to think.
> >> 
> >> Sure would like to get this working again too.
> > 
> > Again, use kdesu, not sudo.
> > 
> > But if some reason you want sudo, /etc/sudoers has some info:
> >   ## Run X applications through sudo
> > 
> > Read the comments there and uncomment what suits you.  Did I mention
> > that you should use kdesu instead of sudo? :-P
> 
> Well, I don't really know what it is using.  I just set up the menu item
> to run the program as root.  I don't know if it uses su -, kdesu, sudo
> or what.  I just know it worked until the upgrade a few days ago.
> 
> Since KDE proclaimed this was supposed to be ready for widespread use
> and cut off KDE3, I sure do wish they would make up their mind HOW
> things are going to work.  I would think they need to know that before
> claiming something was ready for widespread use.  Makes me want to go
> back to KDE 3.5.  At least I could get everything I need to work and
> survive a upgrade too.  ;-)
> 
> Oh well.  This is the new normal for KDE I guess.  lol
> 
> Dale
> 
> :-)  :-)

I don't know what  you are talking about. Setting up menu items? wtf?



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25  3:03       ` Dale
  2010-09-25  7:43         ` Volker Armin Hemmann
@ 2010-09-25  8:14         ` Yohan Pereira
  2010-09-25  9:21           ` Dale
  1 sibling, 1 reply; 23+ messages in thread
From: Yohan Pereira @ 2010-09-25  8:14 UTC (permalink / raw
  To: gentoo-user

On Saturday 25 September 2010 8:33:09 am Dale wrote:
> Well, I don't really know what it is using.  I just set up the menu item
> to run the program as root. 

i assume you mean you setup a menuitem to run a paticular application as root 
like say to run konsole/konqueror as root.

> I don't know if it uses su -, kdesu, sudo

if its a menu item then it has to use kdesu, because sudo and su both take the 
password from teh std input (you wont get a gui prompt to enter the password), 
and nothing will happen. all you have to do is fire up the menu editor, go to 
your menu entry and make sure the command field looks like this "kdesu 
konsole", if it does look like that , try running kdesu from a konsole session 
and see what it prints out (it may not be installed for starters).

-- 
- Yohan Pereira.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25  7:43         ` Volker Armin Hemmann
@ 2010-09-25  9:09           ` Dale
  0 siblings, 0 replies; 23+ messages in thread
From: Dale @ 2010-09-25  9:09 UTC (permalink / raw
  To: gentoo-user

Volker Armin Hemmann wrote:
> On Saturday 25 September 2010, Dale wrote:
>    
>> Nikos Chantziaras wrote:
>>      
>>> On 09/23/2010 04:18 AM, Dale wrote:
>>>        
>>>> Nikos Chantziaras wrote:
>>>>          
>>>>> On 09/22/2010 09:48 PM, Andrey Vul wrote:
>>>>>            
>>>>>> When I launch X programs via sudo, I get the following:
>>>>>>
>>>>>> $sudo gui-admin
>>>>>> No protocol specified
>>>>>> gui-admin: cannot connect to X server :0
>>>>>>
>>>>>> ( Assume gui-admin is an X program )
>>>>>>
>>>>>> But (gk|kde)su(do)? works. This is somewhat confusing.
>>>>>>              
>>>>> sudo doesn't keep the $DISPLAY environment variable by default. There
>>>>> could be other issues too. Best stick to kdesu and friends; that's
>>>>> what they are there for.
>>>>>            
>>>> Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
>>>> either. It worked before but not now. I'm not sure what changed between
>>>> 4.4 and 4.5.1 but it broke my konqueror as root and other programs as
>>>> well. Still have some I haven't tried tho. Konqueror is the one I need
>>>> most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
>>>> me is starting to think.
>>>>
>>>> Sure would like to get this working again too.
>>>>          
>>> Again, use kdesu, not sudo.
>>>
>>> But if some reason you want sudo, /etc/sudoers has some info:
>>>    ## Run X applications through sudo
>>>
>>> Read the comments there and uncomment what suits you.  Did I mention
>>> that you should use kdesu instead of sudo? :-P
>>>        
>> Well, I don't really know what it is using.  I just set up the menu item
>> to run the program as root.  I don't know if it uses su -, kdesu, sudo
>> or what.  I just know it worked until the upgrade a few days ago.
>>
>> Since KDE proclaimed this was supposed to be ready for widespread use
>> and cut off KDE3, I sure do wish they would make up their mind HOW
>> things are going to work.  I would think they need to know that before
>> claiming something was ready for widespread use.  Makes me want to go
>> back to KDE 3.5.  At least I could get everything I need to work and
>> survive a upgrade too.  ;-)
>>
>> Oh well.  This is the new normal for KDE I guess.  lol
>>
>> Dale
>>
>> :-)  :-)
>>      
> I don't know what  you are talking about. Setting up menu items? wtf?
>
>    

I run my programs through the "K menu" thingy.  You know, at the bottom 
left of the screen.  I may be doing mine different but it seems KDE 
doesn't want much of anything being run as root, not the way you are 
trying to do it, not the way I have been doing it.

Still puzzled that Dolphin will work but Konqueror does not.

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25  8:14         ` Yohan Pereira
@ 2010-09-25  9:21           ` Dale
  2010-09-25  9:37             ` Yohan Pereira
  0 siblings, 1 reply; 23+ messages in thread
From: Dale @ 2010-09-25  9:21 UTC (permalink / raw
  To: gentoo-user

Yohan Pereira wrote:
> On Saturday 25 September 2010 8:33:09 am Dale wrote:
>    
>> Well, I don't really know what it is using.  I just set up the menu item
>> to run the program as root.
>>      
> i assume you mean you setup a menuitem to run a paticular application as root
> like say to run konsole/konqueror as root.
>
>    
>> I don't know if it uses su -, kdesu, sudo
>>      
> if its a menu item then it has to use kdesu, because sudo and su both take the
> password from teh std input (you wont get a gui prompt to enter the password),
> and nothing will happen. all you have to do is fire up the menu editor, go to
> your menu entry and make sure the command field looks like this "kdesu
> konsole", if it does look like that , try running kdesu from a konsole session
> and see what it prints out (it may not be installed for starters).
>
>    

You are assuming correctly above.  The way I have always had to set this 
up is like this.  Set up the menu item like I would with any other 
user.  In the Advanced tab, I set it to run as user root.  When I then 
select to run the item from the menu, a little GUI window will pop up 
and ask me for the root password.  This has worked in KDE3 for ages and 
I don't recall having any trouble with it all.  KDE4 has been changing 
things around and I have had to rework things a couple times as KDE4 
seems to keep changing the way things work.

I suspect you may be right, that it uses kdesu.  Just to make sure it 
wasn't a wrong version installed, this is what I have:

root@smoker / # equery list -p kdesu
  * Searching for kdesu ...
[-P-] [  ] kde-base/kdesu-4.4.5:4.4
[IP-] [  ] kde-base/kdesu-4.5.1:4.5
root@smoker / #

So, I do have the latest at least.  I'll try to re-emerge it although I 
think I already did that once.  I know I tried re-emerging some other 
packages trying to get this to work again.

What gets me, I have Dolphin set up the same way, it works just fine.  I 
can also run Konqueror from a root Konsole and it works fine there.  It 
just doesn't like the menu item for some reason.  I suspect it doesn't 
like kdesu for some reason.  Maybe it's a bug and will be fixed or it 
may be a new "feature".  Who knows.

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25  9:21           ` Dale
@ 2010-09-25  9:37             ` Yohan Pereira
  2010-09-25 10:18               ` Dale
  0 siblings, 1 reply; 23+ messages in thread
From: Yohan Pereira @ 2010-09-25  9:37 UTC (permalink / raw
  To: gentoo-user

On Saturday 25 September 2010 2:51:45 pm Dale wrote: 
> In the Advanced tab, I set it to run as user root.  When I then
> select to run the item from the menu, a little GUI window will pop up
> and ask me for the root password.  
 
i just tried that and it worked perfectly for konqueror, maybe you can try 
deleting that menu entry and recreating it. 

if that dosnt work try running kdesu konqueror in a konsole session and see 
what happns.

-- 
- Yohan Pereira.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25  9:37             ` Yohan Pereira
@ 2010-09-25 10:18               ` Dale
  2010-09-26 11:06                 ` Dale
  0 siblings, 1 reply; 23+ messages in thread
From: Dale @ 2010-09-25 10:18 UTC (permalink / raw
  To: gentoo-user

Yohan Pereira wrote:
> On Saturday 25 September 2010 2:51:45 pm Dale wrote:
>    
>> In the Advanced tab, I set it to run as user root.  When I then
>> select to run the item from the menu, a little GUI window will pop up
>> and ask me for the root password.
>>      
>
> i just tried that and it worked perfectly for konqueror, maybe you can try
> deleting that menu entry and recreating it.
>
> if that dosnt work try running kdesu konqueror in a konsole session and see
> what happns.
>
>    

It appears that maybe portage got the order wrong or something was amiss 
with KDE.  I re-emerged the following:

kdebase-menu
kdebase-menu-icons
kmenuedit
kdesu

After that, it works again.  So, either something was built in the wrong 
order or KDE had some issue with something.  Oh, no config files to 
update after that either.

Don't know what fixed it exactly but at least it works again.  Maybe the 
OP should try rebuilding some packages too?  May help, may not.

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-25 10:18               ` Dale
@ 2010-09-26 11:06                 ` Dale
  2010-09-26 14:11                   ` Robin Atwood
  0 siblings, 1 reply; 23+ messages in thread
From: Dale @ 2010-09-26 11:06 UTC (permalink / raw
  To: gentoo-user

Dale wrote:
>
> It appears that maybe portage got the order wrong or something was 
> amiss with KDE.  I re-emerged the following:
>
> kdebase-menu
> kdebase-menu-icons
> kmenuedit
> kdesu
>
> After that, it works again.  So, either something was built in the 
> wrong order or KDE had some issue with something.  Oh, no config files 
> to update after that either.
>
> Don't know what fixed it exactly but at least it works again.  Maybe 
> the OP should try rebuilding some packages too?  May help, may not.
>
> Dale
>
> :-)  :-)

I spoke to soon I guess.  I was gone for a while so I cut my puter off.  
Now, the programs don't work as root again even after recompiling those 
packages again.

This is weird.  Works one time then stops again.

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-26 11:06                 ` Dale
@ 2010-09-26 14:11                   ` Robin Atwood
  2010-09-26 14:28                     ` Dale
  0 siblings, 1 reply; 23+ messages in thread
From: Robin Atwood @ 2010-09-26 14:11 UTC (permalink / raw
  To: gentoo-user

On Sunday 26 September 2010, Dale wrote:
> Dale wrote:
> > It appears that maybe portage got the order wrong or something was
> > amiss with KDE.  I re-emerged the following:
> > 
> > kdebase-menu
> > kdebase-menu-icons
> > kmenuedit
> > kdesu
> > 
> > After that, it works again.  So, either something was built in the
> > wrong order or KDE had some issue with something.  Oh, no config files
> > to update after that either.
> > 
> > Don't know what fixed it exactly but at least it works again.  Maybe
> > the OP should try rebuilding some packages too?  May help, may not.
> > 
> > Dale
> > 
> > :-)  :-)
> 
> I spoke to soon I guess.  I was gone for a while so I cut my puter off.
> Now, the programs don't work as root again even after recompiling those
> packages again.
> 
> This is weird.  Works one time then stops again.

I always run several apps under kdesu and sometimes they don't start. Once I 
did an strace and found it hanging opening /var/tmp/kdecache-user; deleting 
all those solved the problem. 

HTH
-Robin
-- 
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------











^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-26 14:11                   ` Robin Atwood
@ 2010-09-26 14:28                     ` Dale
  0 siblings, 0 replies; 23+ messages in thread
From: Dale @ 2010-09-26 14:28 UTC (permalink / raw
  To: gentoo-user

Robin Atwood wrote:
> On Sunday 26 September 2010, Dale wrote:
>    
>> Dale wrote:
>>      
>>> It appears that maybe portage got the order wrong or something was
>>> amiss with KDE.  I re-emerged the following:
>>>
>>> kdebase-menu
>>> kdebase-menu-icons
>>> kmenuedit
>>> kdesu
>>>
>>> After that, it works again.  So, either something was built in the
>>> wrong order or KDE had some issue with something.  Oh, no config files
>>> to update after that either.
>>>
>>> Don't know what fixed it exactly but at least it works again.  Maybe
>>> the OP should try rebuilding some packages too?  May help, may not.
>>>
>>> Dale
>>>
>>> :-)  :-)
>>>        
>> I spoke to soon I guess.  I was gone for a while so I cut my puter off.
>> Now, the programs don't work as root again even after recompiling those
>> packages again.
>>
>> This is weird.  Works one time then stops again.
>>      
> I always run several apps under kdesu and sometimes they don't start. Once I
> did an strace and found it hanging opening /var/tmp/kdecache-user; deleting
> all those solved the problem.
>
> HTH
> -Robin
>    

I was about to post this.  I logged out of KDE and went to single user.  
I then used ps to list the processes and there was still a kdesu 
running.  I killed it and a couple other left overs, then logged back in 
and everything is working again.  It looks like KDE needs to do a little 
more clean up when logging out.

I did clear some config files and cache files once before.  I lost 
bookmarks somehow.  I need to save those somewhere so I can restore 
them.  ;-)

Dale

:-)  :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-24 23:35     ` Nikos Chantziaras
  2010-09-25  3:03       ` Dale
@ 2010-09-27 17:54       ` Helmut Jarausch
  2010-10-05  5:22         ` Andrey Vul
  1 sibling, 1 reply; 23+ messages in thread
From: Helmut Jarausch @ 2010-09-27 17:54 UTC (permalink / raw
  To: gentoo-user

On 09/25/10 01:35:16, Nikos Chantziaras wrote:
...
> 
> But if some reason you want sudo, /etc/sudoers has some info:
> 
>    ## Run X applications through sudo
> 
> Read the comments there and uncomment what suits you.  Did I mention 
> that you should use kdesu instead of sudo? :-P

Which version of sudo are you talking about?
I have sudo-1.7.4p4 installed here but I don't see any mentioning of 
X11 in sample.sudoers

Thanks for a pointer,
Helmut.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-09-27 17:54       ` Helmut Jarausch
@ 2010-10-05  5:22         ` Andrey Vul
  2010-10-17 12:45           ` Kevin O'Gorman
  0 siblings, 1 reply; 23+ messages in thread
From: Andrey Vul @ 2010-10-05  5:22 UTC (permalink / raw
  To: gentoo-user

sudoers(5):
...
## Run X applications through sudo
Defaults env_keep += "DISPLAY HOME"
...

sudo visudo; paste; done

--
Andrey "m05hbear" Vul



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-10-05  5:22         ` Andrey Vul
@ 2010-10-17 12:45           ` Kevin O'Gorman
  0 siblings, 0 replies; 23+ messages in thread
From: Kevin O'Gorman @ 2010-10-17 12:45 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

On Mon, Oct 4, 2010 at 10:22 PM, Andrey Vul <andrey.vul@gmail.com> wrote:

> sudoers(5):
> ...
> ## Run X applications through sudo
> Defaults env_keep += "DISPLAY HOME"
> ...
>
> sudo visudo; paste; done
>

Except that in the heavily-commented version of the sudoers file that I
have, the corresponding line does not include the DISPLAY variable, and it
happens to work fine that way.  Try just keeping HOME.



-- 
Kevin O'Gorman, PhD

[-- Attachment #2: Type: text/html, Size: 798 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-user] Re: X programs as root
  2010-09-22 18:48 [gentoo-user] X programs as root Andrey Vul
  2010-09-22 19:01 ` Volker Armin Hemmann
  2010-09-22 19:08 ` [gentoo-user] " Nikos Chantziaras
@ 2010-10-17 13:00 ` Nikos Chantziaras
  2010-10-17 13:03   ` Nikos Chantziaras
  2 siblings, 1 reply; 23+ messages in thread
From: Nikos Chantziaras @ 2010-10-17 13:00 UTC (permalink / raw
  To: gentoo-user

On 09/22/2010 09:48 PM, Andrey Vul wrote:
> When I launch X programs via sudo, I get the following:
>
> $sudo gui-admin
> No protocol specified
> gui-admin: cannot connect to X server :0
>
> ( Assume gui-admin is an X program )
>
> But (gk|kde)su(do)? works. This is somewhat confusing.

I just discovered something.  Keeping HOME is not really recommended, 
because the programs that run as root will then use your user's 
configuration files and sometimes will set 'root' as their owner.  As 
you can imagine, this is not a good thing.

It seems what X programs really need is the .Xauthority file of the 
current X session.  All you have to do is add this line to your ~/.bashrc:

   export XAUTHORITY="$HOME/.Xauthority"

Then you don't have to configure sudoers to keep the HOME env var.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-user] Re: X programs as root
  2010-10-17 13:00 ` Nikos Chantziaras
@ 2010-10-17 13:03   ` Nikos Chantziaras
  2010-10-17 15:37     ` Alan McKinnon
  0 siblings, 1 reply; 23+ messages in thread
From: Nikos Chantziaras @ 2010-10-17 13:03 UTC (permalink / raw
  To: gentoo-user

On 10/17/2010 04:00 PM, Nikos Chantziaras wrote:
> On 09/22/2010 09:48 PM, Andrey Vul wrote:
>> When I launch X programs via sudo, I get the following:
>>
>> $sudo gui-admin
>> No protocol specified
>> gui-admin: cannot connect to X server :0
>>
>> ( Assume gui-admin is an X program )
>>
>> But (gk|kde)su(do)? works. This is somewhat confusing.
>
> I just discovered something. Keeping HOME is not really recommended,
> because the programs that run as root will then use your user's
> configuration files and sometimes will set 'root' as their owner. As you
> can imagine, this is not a good thing.
>
> It seems what X programs really need is the .Xauthority file of the
> current X session. All you have to do is add this line to your ~/.bashrc:
>
> export XAUTHORITY="$HOME/.Xauthority"
>
> Then you don't have to configure sudoers to keep the HOME env var.

(I have the tendency to press the "Send" button too soon...)

Setting XAUTHORITY in the user's .bashrc also means that you don't have 
to modify /etc/sudoers *in any way*, not even DISPLAY needs to be kept. 
  Setting XAUTHORITY is *all* what is needed.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-10-17 13:03   ` Nikos Chantziaras
@ 2010-10-17 15:37     ` Alan McKinnon
  2010-10-17 17:13       ` Kevin O'Gorman
  0 siblings, 1 reply; 23+ messages in thread
From: Alan McKinnon @ 2010-10-17 15:37 UTC (permalink / raw
  To: gentoo-user

Apparently, though unproven, at 15:03 on Sunday 17 October 2010, Nikos 
Chantziaras did opine thusly:

> On 10/17/2010 04:00 PM, Nikos Chantziaras wrote:
> > On 09/22/2010 09:48 PM, Andrey Vul wrote:
> >> When I launch X programs via sudo, I get the following:
> >> 
> >> $sudo gui-admin
> >> No protocol specified
> >> gui-admin: cannot connect to X server :0
> >> 
> >> ( Assume gui-admin is an X program )
> >> 
> >> But (gk|kde)su(do)? works. This is somewhat confusing.
> > 
> > I just discovered something. Keeping HOME is not really recommended,
> > because the programs that run as root will then use your user's
> > configuration files and sometimes will set 'root' as their owner. As you
> > can imagine, this is not a good thing.
> > 
> > It seems what X programs really need is the .Xauthority file of the
> > current X session. All you have to do is add this line to your ~/.bashrc:
> > 
> > export XAUTHORITY="$HOME/.Xauthority"
> > 
> > Then you don't have to configure sudoers to keep the HOME env var.
> 
> (I have the tendency to press the "Send" button too soon...)
> 
> Setting XAUTHORITY in the user's .bashrc also means that you don't have
> to modify /etc/sudoers *in any way*, not even DISPLAY needs to be kept.
>   Setting XAUTHORITY is *all* what is needed.


I owe you a beer :-)

One little export and this annoying thingy has now gone away:

$ sudo vi /etc/fstab 
Password: 
No protocol specified


You have NO IDEA how long that has annoyed me and how long I've been searching 
for a solution. Make that two beers!


-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-user] Re: X programs as root
  2010-10-17 15:37     ` Alan McKinnon
@ 2010-10-17 17:13       ` Kevin O'Gorman
  0 siblings, 0 replies; 23+ messages in thread
From: Kevin O'Gorman @ 2010-10-17 17:13 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2466 bytes --]

On Sun, Oct 17, 2010 at 8:37 AM, Alan McKinnon <alan.mckinnon@gmail.com>wrote:

> Apparently, though unproven, at 15:03 on Sunday 17 October 2010, Nikos
> Chantziaras did opine thusly:
>
> > On 10/17/2010 04:00 PM, Nikos Chantziaras wrote:
> > > On 09/22/2010 09:48 PM, Andrey Vul wrote:
> > >> When I launch X programs via sudo, I get the following:
> > >>
> > >> $sudo gui-admin
> > >> No protocol specified
> > >> gui-admin: cannot connect to X server :0
> > >>
> > >> ( Assume gui-admin is an X program )
> > >>
> > >> But (gk|kde)su(do)? works. This is somewhat confusing.
> > >
> > > I just discovered something. Keeping HOME is not really recommended,
> > > because the programs that run as root will then use your user's
> > > configuration files and sometimes will set 'root' as their owner. As
> you
> > > can imagine, this is not a good thing.
> > >
> > > It seems what X programs really need is the .Xauthority file of the
> > > current X session. All you have to do is add this line to your
> ~/.bashrc:
> > >
> > > export XAUTHORITY="$HOME/.Xauthority"
> > >
> > > Then you don't have to configure sudoers to keep the HOME env var.
> >
> > (I have the tendency to press the "Send" button too soon...)
> >
> > Setting XAUTHORITY in the user's .bashrc also means that you don't have
> > to modify /etc/sudoers *in any way*, not even DISPLAY needs to be kept.
> >   Setting XAUTHORITY is *all* what is needed.
>
>
> I owe you a beer :-)
>
> One little export and this annoying thingy has now gone away:
>
> $ sudo vi /etc/fstab
> Password:
> No protocol specified
>
>
> You have NO IDEA how long that has annoyed me and how long I've been
> searching
> for a solution. Make that two beers!
>
> I'm a bit surprised, but this fix actually does work, even without any
special arrangement to
env_keep XAUTHORITY.  But I still don't like it any better than my own
solution

    echo -n ".mybashrc: "
    xhost +root@localhost

which I place in my .mybashrc, where I keep all of my .bashrc
customizations.  My way, it can
remind me what's going on, and seems more direct.  It also works if I "su"
to root.  As an old-timer on Unix, I often forget sudo.  I don't like it
much anyway because it won't get me into root if something goes wrong in
bootup: with this in mind, I need a root PW anyway, until that bottleneck
gets fixed.

The above form is actually only used in a debugging mode I've defined, and
is silent otherwise.

++ kevin

-- 
Kevin O'Gorman, PhD

[-- Attachment #2: Type: text/html, Size: 3378 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2010-10-17 17:14 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22 18:48 [gentoo-user] X programs as root Andrey Vul
2010-09-22 19:01 ` Volker Armin Hemmann
2010-09-22 19:08 ` [gentoo-user] " Nikos Chantziaras
2010-09-23  1:18   ` Dale
2010-09-24 22:24     ` Andrey Vul
2010-09-24 23:35     ` Nikos Chantziaras
2010-09-25  3:03       ` Dale
2010-09-25  7:43         ` Volker Armin Hemmann
2010-09-25  9:09           ` Dale
2010-09-25  8:14         ` Yohan Pereira
2010-09-25  9:21           ` Dale
2010-09-25  9:37             ` Yohan Pereira
2010-09-25 10:18               ` Dale
2010-09-26 11:06                 ` Dale
2010-09-26 14:11                   ` Robin Atwood
2010-09-26 14:28                     ` Dale
2010-09-27 17:54       ` Helmut Jarausch
2010-10-05  5:22         ` Andrey Vul
2010-10-17 12:45           ` Kevin O'Gorman
2010-10-17 13:00 ` Nikos Chantziaras
2010-10-17 13:03   ` Nikos Chantziaras
2010-10-17 15:37     ` Alan McKinnon
2010-10-17 17:13       ` Kevin O'Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox