Zim Tsui changed bug 1205109
What Removed Added
Flags needinfo?(zimtsui@gmail.com)  

Comment # 2 on bug 1205109 from
(In reply to Dr. Werner Fink from comment #1)
> Give the attached shell script as a replacement of /usr/bin/emacs a try and
> report if this does work for you.

I tried that but it doesn't work.

Your substitute script simply replaces `UID` with `EUID`. This is redundant
because `sudo` already handles that well. Try the below as regular user:

```shell
$ sudo sh -c "echo \$UID"
0
$ sudo sh -c "echo \$EUID"
0
```

The key point is that the directory `/run/user/0` doesn't exist if you have
never logged in as root since boot.

`su -` or `sudo -i` simply emulates a login shell, but actually doesn't create
a new session. See
<https://github.com/systemd/systemd/issues/7451#issuecomment-346787237>

A possible solution is doing nothing about the environment. Since emacs has its
own logic about handling the absence of environment variables, why interfere
it?


You are receiving this mail because: