From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Root emacs weirdness Date: Sat, 21 Sep 2013 18:08:58 -0600 Message-ID: <20130922000858.GA355@hysteria.proulx.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1379808558 26991 80.91.229.3 (22 Sep 2013 00:09:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Sep 2013 00:09:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: notbob Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 22 02:09:21 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VNXEn-00086I-K0 for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Sep 2013 02:09:21 +0200 Original-Received: from localhost ([::1]:33454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNXEn-0000Ea-4E for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 20:09:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNXEY-0000EU-B4 for help-gnu-emacs@gnu.org; Sat, 21 Sep 2013 20:09:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNXES-0006LC-C6 for help-gnu-emacs@gnu.org; Sat, 21 Sep 2013 20:09:06 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:57277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNXES-0006L3-4e for help-gnu-emacs@gnu.org; Sat, 21 Sep 2013 20:09:00 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id A1D2E211D5; Sat, 21 Sep 2013 18:08:58 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 754D92DC63; Sat, 21 Sep 2013 18:08:58 -0600 (MDT) Mail-Followup-To: notbob , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93501 Archived-At: 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: # > > .....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