From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46022: 27.1; kill-emacs should call sd_notify only in daemon mode Date: Thu, 21 Jan 2021 21:29:19 +0200 Message-ID: <837do66qcw.fsf@gnu.org> References: <1795381c3a29a50341502c2c020dccfcddf4be05.camel@timruffing.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21172"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46022@debbugs.gnu.org, Lucas Werkmeister To: Tim Ruffing Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 21 20:40:05 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2foL-0005LK-Gc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Jan 2021 20:40:05 +0100 Original-Received: from localhost ([::1]:52256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2foK-0003X8-Fb for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Jan 2021 14:40:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2fec-000834-Q7 for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2021 14:30:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l2fec-0006cO-Er for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2021 14:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l2fec-0007q4-8k for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2021 14:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Jan 2021 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46022 X-GNU-PR-Package: emacs Original-Received: via spool by 46022-submit@debbugs.gnu.org id=B46022.161125739030084 (code B ref 46022); Thu, 21 Jan 2021 19:30:02 +0000 Original-Received: (at 46022) by debbugs.gnu.org; 21 Jan 2021 19:29:50 +0000 Original-Received: from localhost ([127.0.0.1]:59398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2feP-0007pA-La for submit@debbugs.gnu.org; Thu, 21 Jan 2021 14:29:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2feN-0007oy-Q1 for 46022@debbugs.gnu.org; Thu, 21 Jan 2021 14:29:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48592) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2feG-0006UI-H0; Thu, 21 Jan 2021 14:29:40 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2330 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l2fe2-0000Ec-Fx; Thu, 21 Jan 2021 14:29:28 -0500 In-Reply-To: <1795381c3a29a50341502c2c020dccfcddf4be05.camel@timruffing.de> (message from Tim Ruffing on Thu, 21 Jan 2021 17:26:31 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198341 Archived-At: > From: Tim Ruffing > Date: Thu, 21 Jan 2021 17:26:31 +0100 > > When run with --fg-daemon mode (as done by the provided systemd unit > file "emacs.service"), emacs will call sd_notify() on startup to notify > systemd about its status. On exit, emacs will call sd_notify() > unconditionally, i.e., even when not run in daemon mode. > > This means that when the daemon is running, other emacs processes > derived from the main process (e.g., in batch mode started by the async > package) may send exit notifications when they're exiting, even though > the main daemon process is not exiting. systemd will (correctly) ignore > these notifications because they come from the wrong PID; this is the > lucky default value of "NotifyAccess=main" in the systemd unit, i.e., > only the main PID may send notifications. However, systemd will also > emit a warning in this case. With my config, this results in a lot of > warning messages in the systemd user journal: I'm not an expert on systemd, not even close, but please review the reasoning for what we do in bug#31498, and let's take it from there. Quote: Both of these calls are successful no-ops if emacs was not started by systemd. CC'ing Lucas, who submitted that changeset, in case hoe would like to comment.