From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1725984-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id E440E1582EF
	for <garchives@archives.gentoo.org>; Sun, 09 Mar 2025 20:48:01 +0000 (UTC)
Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	(Authenticated sender: relay-lists.gentoo.org@gentoo.org)
	by smtp.gentoo.org (Postfix) with ESMTPSA id C7FEC343124
	for <garchives@archives.gentoo.org>; Sun, 09 Mar 2025 20:48:01 +0000 (UTC)
Received: from bobolink.gentoo.org (localhost [127.0.0.1])
	by bobolink.gentoo.org (Postfix) with ESMTP id 361D611037D;
	Sun, 09 Mar 2025 20:47:58 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by bobolink.gentoo.org (Postfix) with ESMTPS id 2D40B11037D
	for <gentoo-commits@lists.gentoo.org>; Sun, 09 Mar 2025 20:47:58 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D4DA63430E1
	for <gentoo-commits@lists.gentoo.org>; Sun, 09 Mar 2025 20:47:57 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 6CF6427E6
	for <gentoo-commits@lists.gentoo.org>; Sun, 09 Mar 2025 20:47:56 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1741551678.071286eb7bfc3f4466f2f96bdcbcf69e314fa578.ulm@gentoo>
Subject: [gentoo-commits] proj/emacs-tools:emacs-common commit in: /
X-VCS-Repository: proj/emacs-tools
X-VCS-Files: ChangeLog Makefile emacs.service
X-VCS-Directories: /
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 071286eb7bfc3f4466f2f96bdcbcf69e314fa578
X-VCS-Branch: emacs-common
Date: Sun, 09 Mar 2025 20:47:56 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 06d199e0-09f4-4d4f-9647-a435b685ff47
X-Archives-Hash: 2c25b7cc5cdfb12e40e887f5c8574a89

commit:     071286eb7bfc3f4466f2f96bdcbcf69e314fa578
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  9 20:21:18 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Mar  9 20:21:18 2025 +0000
URL:        https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=071286eb

Add user unit file for systemd

* emacs.service: New file. User unit file for systemd, copied
from Emacs 30.1.
* Makefile (DISTFILES): Add it.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog     |  4 ++++
 Makefile      |  2 +-
 emacs.service | 19 +++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index dabba3c..c07710f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2025-03-09  Ulrich Müller  <ulm@gentoo.org>
 
+	* emacs.service: New file. User unit file for systemd, copied
+	from Emacs 30.1.
+	* Makefile (DISTFILES): Add it.
+
 	* emacs-wrapper.sh: New file, moved here from emacs-daemon.
 	* 10emacs-common-gentoo.el: Ditto. Simplified.
 	* Makefile (DISTFILES): Add them.

diff --git a/Makefile b/Makefile
index bedfc9f..3385d1f 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ ICONFILES = sink.png \
 GSCHEMAFILES = org.gnu.emacs.defaults.gschema.xml
 DISTFILES = README.gentoo.in README.daemon \
 	site-start.el site-gentoo.el subdirs.el.in 10emacs-common-gentoo.el \
-	emacs.initd emacs-wrapper.sh \
+	emacs.initd emacs-wrapper.sh emacs.service \
 	$(DESKTOPFILES) $(addprefix icons/,COPYRIGHT.icons $(ICONFILES)) \
 	$(GSCHEMAFILES)
 

diff --git a/emacs.service b/emacs.service
new file mode 100644
index 0000000..bb2e181
--- /dev/null
+++ b/emacs.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Emacs text editor
+Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
+
+[Service]
+Type=notify
+ExecStart=/usr/bin/emacs --fg-daemon
+
+# Emacs will exit with status 15 after having received SIGTERM, which
+# is the default "KillSignal" value systemd uses to stop services.
+SuccessExitStatus=15
+
+# The location of the SSH auth socket varies by distribution, and some
+# set it from PAM, so don't override by default.
+# Environment=SSH_AUTH_SOCK=%t/keyring/ssh
+Restart=on-failure
+
+[Install]
+WantedBy=default.target