Bug 81820 - emacs gets into loop trying to create /root/.emacs.d
emacs gets into loop trying to create /root/.emacs.d
Product: Red Hat Raw Hide
Classification: Retired
Component: emacs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Jay Turner
Depends On:
  Show dependency treegraph
Reported: 2003-01-14 03:50 EST by Jonathan Kamens
Modified: 2015-01-07 19:02 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-01-21 03:18:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2003-01-14 03:50:40 EST
I used "sudo -s" to get a root shell and then "su news" to get a news shell, and
then ran "emacs -nw /etc/news/incoming.conf" to edit a configuration file. 
Part-way through that editing task, Emacs started beeping repeatedly and
displaying a message in the minibuffer indicating that it could not create
/root/.emacs.d.  I finally had to send a kill signal to the Emacs process, at
which point it coredumped.

I'm current WRT Raw Hide, including emacs-21.2-27.
Comment 1 Jens Petersen 2003-01-15 12:52:02 EST
I don't have an "/etc/news/incoming" files, but I just tried editting
a new file in "/etc/news" and emacs created an autosave backup file in
"/etc/news" without any problems.
Comment 2 Jens Petersen 2003-01-15 12:56:50 EST
Further I should have said "/etc/news/.emacs.d/auto-save-list/"
was created in the process.  Is your "/etc/news" owned by news?
Comment 3 Jonathan Kamens 2003-01-15 14:14:45 EST
The sequence of steps I used to get to where the problem exhibited itself is
significant.  Using "sudo -s" followed by "su news" leaves the environment in a
state where some environment variables say that the user is root rather than
news.  If you used some other mechanism to become news before editing the file
in /etc/news, the environment probably wasn't set up in such a way as to confuse

How did you become "news" before attempting to edit the file in /etc/news?
Comment 4 Jonathan Kamens 2003-01-15 14:15:55 EST
Whether or not my /etc/news is owned by news is irrelevant, since as I said, the
infinite loop was while Emacs was trying to create a directory in /root, not in
Comment 5 Jens Petersen 2003-01-15 22:49:13 EST
I did

% sudo -s
% su news
% emacs /etc/news/test.file

My default shell is zsh, if that matters?
Comment 6 Jonathan Kamens 2003-01-15 22:52:23 EST
Aha.  I forgot a crucial fact.  I used "su -m", not "su", which means that
root's environment was preserved, including the HOME environment variable, which
is probably the culprit.  Try that.

(Please don't say this is the fault of using "su -m"; Emacs needs to be able to
cope with an unwritable HOME without going into an infinite loop. :-)
Comment 7 Jens Petersen 2003-01-28 04:11:23 EST
Yep, reproduced from a bash login shell.  (Fwiw this problem doesn't
to occur if one starts from zsh AFAICT.)

With "sudo -s" the error seems to be in the original user's homedir;
with "su" the error is in /root.

Comment 8 Jens Petersen 2004-01-15 00:43:21 EST
Any better with 21.3?  I can't seem to reproduce it any more.
Comment 9 Jonathan Kamens 2004-01-15 09:45:31 EST
I can no longer duplicate the problem with emacs-21.3-7.

Note You need to log in before you can comment on or make changes to this bug.