All of lore.kernel.org
 help / color / mirror / Atom feed
From: <rs@ti.com>
To: <denis@denix.org>, <reatmon@ti.com>
Cc: <meta-arago@lists.yoctoproject.org>, <praneeth@ti.com>, <s-jain1@ti.com>
Subject: [meta-arago][scarthgap][PATCH 1/2] emptty: backport fix for signal handeling
Date: Wed, 1 Oct 2025 13:31:01 -0500	[thread overview]
Message-ID: <20251001183102.357345-1-rs@ti.com> (raw)

From: Randolph Sapp <rs@ti.com>

To quote the upstream patch:

	Emptty cannot currently exit via an external signal if the
	session process exits abnormally. This conflicts with the
	expected behavior of systemd, which expects that the service
	will always respect signals.

	This has the added benefit of allowing users to use ^C to
	restart the login process at any point in the menu system.

Backporting this since it hasn't hit a tagged release yet.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 .../recipes-graphics/emptty/emptty.inc        |  1 +
 ...Interrupt-handle-unruly-applications.patch | 52 +++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/0001-handleInterrupt-handle-unruly-applications.patch

diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty.inc b/meta-arago-distro/recipes-graphics/emptty/emptty.inc
index b452d403..4f23cf79 100644
--- a/meta-arago-distro/recipes-graphics/emptty/emptty.inc
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty.inc
@@ -19,6 +19,7 @@ SRC_URI = "\
     git://${GO_IMPORT_pam}.git;protocol=https;branch=master;name=pam;destsuffix=src/${GO_IMPORT_pam} \
     file://pamconf \
     file://emptty.tab \
+    file://0001-handleInterrupt-handle-unruly-applications.patch;patchdir=src/${GO_IMPORT} \
     "
 SRCREV = "d162bef75fadc8ae1d8e33dbb3de5e2795a196e0"
 SRCREV_pam = "50ded1b0e7864b9bf75005eb945a8ec826bcf69d"
diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty/0001-handleInterrupt-handle-unruly-applications.patch b/meta-arago-distro/recipes-graphics/emptty/emptty/0001-handleInterrupt-handle-unruly-applications.patch
new file mode 100644
index 00000000..ecd190e5
--- /dev/null
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty/0001-handleInterrupt-handle-unruly-applications.patch
@@ -0,0 +1,52 @@
+From cce0e23719f30a362dc5de69eb92d9a1c0859403 Mon Sep 17 00:00:00 2001
+From: Randolph Sapp <rs@ti.com>
+Date: Tue, 30 Sep 2025 20:05:05 -0500
+Subject: [PATCH] handleInterrupt: handle unruly applications
+
+Emptty cannot currently exit via an external signal if the session
+process exits abnormally. This conflicts with the expected behavior of
+systemd, which expects that the service will always respect signals.
+
+This has the added benefit of allowing users to use ^C to restart the
+login process at any point in the menu system.
+
+
+Upstream-Status: Backport [https://github.com/tvrzna/emptty/commit/d875bac9ce22c2739dfd4644880371b6e16a1cb6]
+Signed-off-by: Randolph Sapp <rs@ti.com>
+---
+ src/emptty.go | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/src/emptty.go b/src/emptty.go
+index b5bc735..97d00f0 100644
+--- a/src/emptty.go
++++ b/src/emptty.go
+@@ -61,14 +61,19 @@ func handleInterrupt(c chan os.Signal, h *sessionHandle) {
+ 	setTerminalEcho(os.Stdout.Fd(), true)
+ 	if h.session != nil && h.session.cmd != nil {
+ 		h.session.interrupted = true
+-		h.session.cmd.Process.Signal(os.Interrupt)
+-		h.session.cmd.Wait()
+-	} else {
+-		if h.auth != nil {
+-			h.auth.closeAuth()
++		if err := h.session.cmd.Process.Signal(os.Interrupt); err != nil {
++			logPrint("Application not responding to signal")
++		} else {
++			// Only attempt clean shutdown if cmd is still
++			// responsive
++			h.session.cmd.Wait()
+ 		}
+-		os.Exit(1)
+ 	}
++	// Always attempt to close active auth instances before exit
++	if h.auth != nil {
++		h.auth.closeAuth()
++	}
++	os.Exit(1)
+ }
+ 
+ // Process core arguments for help and version, because they don't require any further application run
+-- 
+2.51.0
+
-- 
2.51.0



             reply	other threads:[~2025-10-01 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01 18:31 rs [this message]
2025-10-01 18:31 ` [meta-arago][scarthgap][PATCH 2/2] weston-init-arago: add weston-init to the rprovides rs
2025-10-22 17:04   ` Denys Dmytriyenko
2025-10-01 18:36 ` [meta-arago][scarthgap][PATCH 1/2] emptty: backport fix for signal handeling PRC Automation

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251001183102.357345-1-rs@ti.com \
    --to=rs@ti.com \
    --cc=denis@denix.org \
    --cc=meta-arago@lists.yoctoproject.org \
    --cc=praneeth@ti.com \
    --cc=reatmon@ti.com \
    --cc=s-jain1@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.