From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: how to tell graphical Emacs to shutdown cleanly from tty1? Date: Tue, 17 Nov 2015 05:05:43 +0100 Message-ID: <87si459so8.fsf@debian.uxu> References: <87si45wbp2.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447732573 14614 80.91.229.3 (17 Nov 2015 03:56:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 03:56:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 17 04:56:03 2015 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 1ZyXND-0007LS-27 for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Nov 2015 04:56:03 +0100 Original-Received: from localhost ([::1]:55514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyXNC-0003nM-Jv for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Nov 2015 22:56:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyXN1-0003mM-CQ for help-gnu-emacs@gnu.org; Mon, 16 Nov 2015 22:55:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyXMx-0003mw-Af for help-gnu-emacs@gnu.org; Mon, 16 Nov 2015 22:55:51 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:37425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyXMx-0003mn-3s for help-gnu-emacs@gnu.org; Mon, 16 Nov 2015 22:55:47 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZyXMu-0006sI-Ny for help-gnu-emacs@gnu.org; Tue, 17 Nov 2015 04:55:44 +0100 Original-Received: from nl106-137-244.student.uu.se ([130.243.137.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Nov 2015 04:55:44 +0100 Original-Received: from embe8573 by nl106-137-244.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Nov 2015 04:55:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-244.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:7ByjHgWjnDj1xzNhCF/asacfCYY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:108107 Archived-At: Tom Roche writes: > Lately I run GNU Emacs mostly as GUI on X/tty7 > (which I'll call "the desktop" as opposed to > emacs-desktop) on one of my Debian laptops. Yes - the pecking order is: (boot) -> ... -> tty6 -> X (in tty7) -> GNOME or KDE with a window manager -> GUI Emacs The "desktop" is the GNOME/KDE/whatever part. You can do without it like this: 1. Disable the login manager (google your desktop to find out what it is). 2. Now the computer won't start X. 3. So instead you do it with manually with startx(1) or xinit(1) (put such a call is the shell's "profile" file - e.g., ~/.zprofile for zsh - to have it automatized if you want it on every boot). 4. In ~/.xinitrc, start a window manager, e.g. openbox(1), in the *background* (with "&" after the command) - last, add a call to a terminal emulator (e.g., xterm), *not* running in the background. Done - either start Emacs in xinitrc as well, or do it from xterm. Now you have the same GUI Emacs but without the diffuse desktop stuff! > Occasionally the desktop hangs Try my method and see if it still does. It "shouldn't" in either case, but if it does, it does. > in which case I usually can goto tty1 and `sudo > shutdown -whatever now`. Unfortunately this does not > seem to cause Emacs to shut down as cleanly as I'd > like: I'd like Emacs to (e.g.) save any unsaved > buffers and save its emacs-desktop, but that doesn't > seem to get done. (Am I missing something?) Well, the problem isn't "how to shut Emacs down gracefully when the desktop is hanged" but "why does the desktop hang and how can I fix it?" That said, the man page for kill(1) may help you. > So I'm thinking that, in this usecase, I should > utter something from tty1 (before `shutdown`) to > tell Emacs to shutdown cleanly ... but I don't know > what to say. How to do this? You can hope to do something with IPC and kill in particular, but again, get the desktop working or get it away is the actual solution. -- underground experts united http://user.it.uu.se/~embe8573