Re: Unable to use "Run command as root"

  • From: <tpgww@xxxxxxxxxxx>
  • To: emelfm2@xxxxxxxxxxxxx
  • Date: Wed, 2 Jul 2014 19:15:30 +1000

On Tue, 01 Jul 2014 22:35:38 +0200
"Erik P. Olsen" <epodata@xxxxxxxxx> wrote:

> Trying to run gedit as root produces following output:
>  >pkexec gedit  (3079)
> error: XDG_RUNTIME_DIR not set in the environment.
> Unable to init server: Could not connect: Connection refused
> (gedit:3079): Gtk-WARNING **: cannot open display:
>  >pkexec gedit (3079) returned '1'
> Am I missing something?


When I try to run here pkexec <something>
in a terminal, I currently get the same error message. Before my last system 
upgrade, pkexec worked sometimes, IIRC. I've concluded it's just unreliable. 
Not an emelfm2 thing.

One guess that the desktop environment's establishment process is missing

XDG_RUNTIME_DIR = whatever

Or maybe it's a more significant bug.

I seem to recall there are some constraints on the approach pkexec takes when 
setting up a 'transitory' root-like context, and the xserver permissions figure 
prominently in there.

Maybe worth reverting to the old pre-pkexec approach, something like

xterm -e 'su -c "%{(root-commands)@Enter command:}";echo -n "Done. Press enter 


Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: