f16 error on starting emacs from root as "su -"

Suvayu Ali fatkasuvayu+linux at gmail.com
Mon Sep 3 22:36:43 UTC 2012


On Mon, Sep 03, 2012 at 12:37:57PM -0700, jackson byers wrote:
> f16 error on starting emacs from  root as "su -"
> 
> [root at f16a9 ~]# emacs test.sudash &
> [1] 2042

[...]

> [1]+  Stopped                 emacs test.sudash
> [root at f16a9 ~]#

Disclaimer: I'm not entirely sure about what I write below.

Emacs in Fedora is compiled with D-BUS support, when started as above
the necessary environment variables are missing and Emacs tries to start
in -nw mode; however since you put it in the background, it gets
stopped.  If you were to type `fg' next, you would see Emacs in -nw mode
in the terminal.

> 
> If I go to root as "su"  [no dash]
> then I do get an emacs window,
> although with an annoying error message:
> [root at f16a9 byers]# emacs test.sunodash &
> [1] 2071
> [root at f16a9 byers]#

When started like this, although $UID is 0, the $USER is still you.
Similarly other environment variables like the DBUS session id is
inherited which allows the Emacs gui to start up.

When working as root, I would recommend using emacs -nw.  If you really
want to have a gui, you can try using sudo with tramp.

HTH

-- 
Suvayu

Open source is the future. It sets us free.


More information about the users mailing list