From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bingo Newsgroups: gmane.emacs.help Subject: Re: make install does not setup systemd correctly Date: Mon, 16 Jul 2018 20:03:07 +0530 Message-ID: <20180716200307.50a7bbdb@gmail.com> References: <20180715162748.5c9a123d@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1531750710 22041 195.159.176.226 (16 Jul 2018 14:18:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2018 14:18:30 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 16 16:18:26 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ff4KY-0005fH-BS for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Jul 2018 16:18:26 +0200 Original-Received: from localhost ([::1]:52040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ff4Mf-0002xg-Dn for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Jul 2018 10:20:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ff4Kk-0001wV-2W for help-gnu-emacs@gnu.org; Mon, 16 Jul 2018 10:18:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ff4Kf-0004kl-4J for help-gnu-emacs@gnu.org; Mon, 16 Jul 2018 10:18:38 -0400 Original-Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:38739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ff4Ke-0004kI-OR for help-gnu-emacs@gnu.org; Mon, 16 Jul 2018 10:18:33 -0400 Original-Received: by mail-pg1-x543.google.com with SMTP id k3-v6so7557789pgq.5 for ; Mon, 16 Jul 2018 07:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KCelXhUUMlh/q4rq4PbGOWKw0UvV2o869jUZoa9oM5U=; b=XGPPKqZFEomJkYo5CApIJApAcSzwQu+HydkmDGHBp4x29IKfcQTHYoLokN3iZJuDGS EGmMlnoABZf3WWwf+y0OhdcBeyta++Rcem789K+3yE2hQ269CeuSq08Sz8tldwB8XO87 7GvPKyl4JNsdpGF5bvFSwEPQok2Vl5Jc3BJIRFHBCinnV+sFFclIgTimlpp2Wqrpu2ZR nR23Tg1QN0AKZekNPXUDdvaSIfCbrfm7Zh+06YGl7ukmslZF0fx7fX1gbHeL/VWheiwN 2OK9Jty0P7XRxprkcAN77gxrYMRMYu1rnh8E4N9MHNK2h+OapbWON3jHg2X3LDn3TAQ5 kRMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KCelXhUUMlh/q4rq4PbGOWKw0UvV2o869jUZoa9oM5U=; b=N5fUDQAmBbRIgpTRLU/Nz4v2E6j2FsoMOipmv8QWDXeq1GWyGPYF7rsqSwgz52RMRf fZWidD0NcVlB6amaScKtexuAg7VsV1mqJ+448xd5NGCqcxz1CA4DC5s3Odg/Zv4S6aZo bcUVV6+Pgcjl+LR3syTzszNMs3plh3sPcZ0XV+3jWGIYChTeEZxeS77aUShdFSdHf4eg O/JLSU9P5dw7eKPVQD/S2VIh8r+Y1QrefNt8m1J0U/RlMvgXgLIlse57bMR+czR7hPz4 RmLSb0X3YBWPVO0h8yIuitdO7sdQIKICT6Lgehg70gJPOEkMJ8oz2pa0NvnFDD3p7lYQ 7oNw== X-Gm-Message-State: AOUpUlF6jf0fdXdyFym1sBJ6T4r8bNvBAOmc84nrz/WaModNvZ8QdSWZ KaEihqgZLWzgQXlxDAJsMKCr3g== X-Google-Smtp-Source: AAOMgpd4+HI8UuML6JgARoRHZ08TN+HCdU9gKlgnS4Ryb8SDQni44apoUM0VHdoRNCQuAt+TPJVvOA== X-Received: by 2002:a63:1015:: with SMTP id f21-v6mr15929776pgl.354.1531750711267; Mon, 16 Jul 2018 07:18:31 -0700 (PDT) Original-Received: from localhost ([122.171.82.187]) by smtp.gmail.com with ESMTPSA id 1-v6sm59273360pfm.145.2018.07.16.07.18.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 07:18:31 -0700 (PDT) In-Reply-To: X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:117462 Archived-At: Thanks Noam. See replies inline On Sun, 15 Jul 2018 20:40:21 -0400 Noam Postavsky wrote: > On 15 July 2018 at 06:58, Bingo wrote: > > Hi, > > On my Fedora installation, emacs 25.3 was already installed > > in /usr/bin. In another > > location (~/Downloads/emacs26/install/bin/emacs) , I installed > > emacs 27.0 from source using ./configure, make and make install. > > $PATH contains ~/Downloads/emacs26/install/ before /usr/bin. > > > > In this state, running "emacs --daemon" creates a emacs process, > > using the binary from ~/Downloads/emacs26/install as a subprocess > > of systemd. > > As far as I understand it, when you are running systemd, every process > is a subprocess of systemd, because it's the init process, so it's at > the root of the process tree. In my case, it is not exactly so. There is another, non-init, non PID 1 process of systemd , with PID 4142 in this case, under which these emacs daemons reside. To illustrate : bingo 4142 1 0 juil.15 ? 00:00:00 /usr/lib/systemd/systemd --user bingo 9976 4142 0 juil.15 ? 00:00:10 /home/bingo/Downloads/emacs26/install/bin/emacs --daemon > > > But the systemd configuration still uses the configuration info > > from /lib/systemd/user/emacs.service, which is from the > > pre-installed emacs 25.3. Any systemd operations end up using the > > binary from /usr/bin. > > Maybe because it doesn't use your $PATH configuration? The > emacs.service file doesn't seem to have anything version specific in > it. I had checked the symlink /proc/9976/exe : it does point the way I expect from $PATH i.e. /home/bingo/Downloads/emacs26/install/bin/emacs. The emacs.service has an extremely version specific thing in it : "ExecStart=/usr/bin/emacs --daemon". This is an emacs binary which is 25.3 - but probably it could have been any version. > > > 1. Emacs man page, or --help does not give an obvious way to not use > > systemd for its daemon. Is it supported at all ? > > I guess just don't use any "systemd operations"? The configuration that ships with emacs has, e.g., Restart=on-failure ExecStart=/usr/bin/emacs --daemon I am guessing that emacs is coming under the "on-failure" condition somehow. So the "systemd operations" are not being used intentionally. Since I am not sure what could have caused on-failure, so I am not asking about that problem here. But only with an improvement to the emacs installation process in mind, I am asking these questions. > > Currently Emacs doesn't use systemd at all, except that it takes > sockets passed by systemd and makes them available to the > `:use-external-socket' option of `make-network-process'. Specifically becoming a subprocess of a particular systemd process seems to be more than taking sockets - but maybe there are some terms here that I don't fully understand. > > > 2. If we are not making it easy to avoid systemd, let us configure > > it while installing? Emacswiki says that we need to copy the > > included emacs.service file to > > ~/.config/systemd/user/emacs.service. It seems to help - my > > emacsclient has not been hanging since then. But couldn't make > > install have copied this file by default ? Or used emacs.service > > file from the correct place when a binary from this emacs 27.0 > > installation is being run as daemon ? > > According to this comment in Makefile.in, it's not entirely clear > where the service file should get installed. > > # Where the etc/emacs.service file is to be installed. > # The system value (typically /usr/lib/systemd/user) can be > # obtained with: pkg-config --variable=systemduserunitdir systemd > # but that does not respect configure's prefix. > # It is not clear where we should install this file when > # prefix != /usr (or /usr/local?) (eg for non-root installs). > # Other options include ~/.config/systemd/user/, > # $XDG_RUNTIME_DIR/systemd/user/ > # It seems the user may end up having to make a manual link... > systemdunitdir=$(libdir)/systemd/user Ok, so it looks like ~/.config/systemd/user was considered. I agree that it may not be ideal. I am not sure if systemd makes it possible to use $PREFIXDIR/lib/systemd/user/emacs.service . thanks