all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: notbob <notbob@nothome.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Root emacs weirdness
Date: Sat, 21 Sep 2013 18:08:58 -0600	[thread overview]
Message-ID: <20130922000858.GA355@hysteria.proulx.com> (raw)
In-Reply-To: <slrnl3r0gq.2n3.notbob@nbleet.hcc.net>

notbob wrote:
> While learning about linux gutz, I used emacs dired by root to edit
> /proc/sys/kernel/dmesg_restrict file from a 1 to a 0.

Your misunderstanding starts with missing that the entire /proc is not
a real filesystem.  It is a fake filesystem.  It is meant as a way to
present kernel data to the user.  It is not intended to hold random
files.  When you try to create backups in that directory the backup of
the file can't exist there.

> Opened emacs / from root, then went to said dir and edited file.
> Upon trying to edit file using e, I get this in the mini-buffer:
>
> Buffer is read-only: #<buffer dmesg_restrict>
>
> .....but, I was then able to edit the file, nonetheless.  ???

Root can normally edit any file in the normal file system regardless
of permissions.  So emacs will continue to let you try.

> File permissions are 644.  When it came time to save the
> dmesg_restrict file using C-x C-s, I get:
> 
> Cannot modify backup file  ....something or other.....
> IO error writing /proc/sys/kernel/dmesg_restrict: Invalid argument

Since /proc isn't a real file system many of the normal things editors
try to do to files cannot work.  The attempt is "invalid" since the
context does not allow it.

> Yet, in the end, the file is modified.

I am sure that emacs does eventually write the buffer contents to the
pseudo-file.  That will work.  Same as the normal thing.

  echo "1" > /proc/path/to/control

> Also, jumping up to the parent dir (/proc/sys/kernel), I see no
> back-up file (foo~) is created.

All of /proc is a fake filesystem.  You can't create random files
there.  Invalid.

> What the heck is --or is not-- going on??

Don't try to edit files in /proc.  It isn't a real file system.  All
of /proc is a representation of kernel data structures.  As a limited
interface you can change some of the values.

  echo "1" > /proc/path/to/control

But that is a very limited operational set of actions.

Bob



  reply	other threads:[~2013-09-22  0:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21 11:22 Root emacs weirdness notbob
2013-09-22  0:08 ` Bob Proulx [this message]
     [not found] ` <mailman.2682.1379808553.10748.help-gnu-emacs@gnu.org>
2013-09-22  3:00   ` notbob
2013-09-22  3:55   ` Barry Margolin

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=20130922000858.GA355@hysteria.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=notbob@nothome.com \
    /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.