all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
To: Tomas Nordin <tomasn@posteo.net>
Cc: Perry Smith <pedz@easesoftware.com>,
	help-gnu-emacs@gnu.org, Steinar Bang <sb@dod.no>
Subject: Re: How to make emacs stop trying to load /home/sb/.emacs after su to root?
Date: Tue, 9 Jul 2019 22:20:47 +0200	[thread overview]
Message-ID: <20190709202047.GF15938@tuxteam.de> (raw)
In-Reply-To: <87wogr0ybf.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me>

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

On Tue, Jul 09, 2019 at 10:04:20PM +0200, Tomas Nordin wrote:
> tomas@tuxteam.de writes:
> 
> > On Tue, Jul 09, 2019 at 09:00:11PM +0200, Tomas Nordin wrote:
> >> Perry Smith <pedz@easesoftware.com> writes:
> >
> > [...]
> >
> >> >> How can I make emacs stop loading the original user's .emacs when
> >> >> logged in as root?
> >> >
> >> > Can you do “id” after you do the su?  Usually “su - root” is the suggested method.
> >> > The ‘-‘ causes the users environment to get loaded or something.  Never looked
> >> > too deep into it.
> >> 
> >> After su;
> >> 
> >> # id
> >> uid=0(root) gid=0(root) groups=0(root)
> >> 
> >> After su - root;
> >> 
> >> # id
> >> uid=0(root) gid=0(root) groups=0(root)
> >> 
> >> but after this latter way of getting root emacs did not try to load
> >> /home/tomas/.emacs
> >> 
> >> Just metooing
> >
> > Have you checked the environment? What does $HOME say? (although the
> > "su -" part lets one expect that the HOME var is set anew: checking
> > won't hurt :-)
> 
> echo $HOME gave /root after both su methods

Hm. Was somewhat to be expected. Still... bizarre. You could try to
compare the result of "set" (displays the whole environment) after
both "su" variants: perhaps you find an environment variable which
could explain this behaviour. As a guide you can look up the env
variables relevant to Emacs in the manual; online here [1] [2].

But we don't know (yet) whether an env variable is the culprit
(although it seems compelling...)

Cheers

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html#General-Variables
[2] https://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Variables.html#Misc-Variables

-- t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2019-07-09 20:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 22:16 How to make emacs stop trying to load /home/sb/.emacs after su to root? Steinar Bang
2019-07-08 23:20 ` Stefan Monnier
2019-07-11 17:59   ` Steinar Bang
2019-07-11 18:09     ` Steinar Bang
2019-07-11 18:24       ` Steinar Bang
2019-07-11 18:41         ` Steinar Bang
2019-07-11 19:03           ` Steinar Bang
2019-07-12  2:56       ` Perry Smith
2019-07-12 16:11         ` Steinar Bang
2019-07-12 16:33           ` Stefan Monnier
2019-07-12 21:41             ` Steinar Bang
2019-07-13  5:30               ` Steinar Bang
2019-07-13 15:04               ` Perry Smith
2019-07-13 18:04                 ` Steinar Bang
2019-07-09  0:40 ` Perry Smith
2019-07-09 19:00   ` Tomas Nordin
2019-07-09 19:15     ` tomas
2019-07-09 20:04       ` Tomas Nordin
2019-07-09 20:20         ` tomas [this message]
2019-07-10 14:42           ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190709202047.GF15938@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pedz@easesoftware.com \
    --cc=sb@dod.no \
    --cc=tomasn@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.