diff mbox series

[meta-arago,scarthgap,1/2] emptty: handle legacy init a litte better

Message ID 20250319211149.730403-1-rs@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,scarthgap,1/2] emptty: handle legacy init a litte better | expand

Commit Message

Randolph Sapp March 19, 2025, 9:11 p.m. UTC
From: Randolph Sapp <rs@ti.com>

I've found some odd behavior with this application when it comes to
daemonization and working with legacy init systems. Some of this was
related to sequencing regarding this script and the depedent seat
script, other parts are just related to this application. This fixes up
most of that behavior until it can be addressed upstream.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 .../recipes-graphics/emptty/emptty/init       | 23 +++++++++++++++----
 .../recipes-graphics/emptty/emptty_0.13.0.bb  |  7 +++---
 2 files changed, 22 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty/init b/meta-arago-distro/recipes-graphics/emptty/emptty/init
index f6bc79f9..114177c8 100644
--- a/meta-arago-distro/recipes-graphics/emptty/emptty/init
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty/init
@@ -1,4 +1,13 @@ 
 #!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: emptty
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start:     5
+# Default-Stop:      0 1 2 3 6
+# X-Interactive: true
+### END INIT INFO
 
 PIDFILE=/var/run/emptty.pid
 
@@ -8,16 +17,22 @@  PIDFILE=/var/run/emptty.pid
 case "$1" in
 	start)
 		echo "Starting display manager: emptty"
-		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		start-stop-daemon -b -S -p $PIDFILE -x /usr/bin/emptty -- -d
 		;;
 	stop)
 		echo "Stopping display manager: emptty"
-		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		start-stop-daemon -K -p $PIDFILE -x /usr/bin/emptty
 		;;
 	restart)
-		start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/bin/emptty
+		start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/bin/emptty -- -d
 		sleep 2
-		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		start-stop-daemon -b -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	reload|force-reload)
+		start-stop-daemon -K -p $PIDFILE -s 1 -x /usr/bin/emptty
+		;;
+	status)
+		status /usr/bin/emptty
 		;;
 	*)
 		echo "usage: $0 { start | stop | restart }"
diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb b/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
index 7129426d..176c9537 100644
--- a/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
@@ -9,6 +9,7 @@  SRC_URI = "\
     git://${GO_IMPORT}.git;protocol=https;branch=master \
     git://${GO_IMPORT_pam}.git;protocol=https;branch=master;name=pam;destsuffix=${S}/src/${GO_IMPORT_pam} \
     file://pamconf \
+    file://init \
     "
 SRCREV = "4046552b6f5cc1cf76ce8bf333e04e16c59febca"
 SRCREV_pam = "50ded1b0e7864b9bf75005eb945a8ec826bcf69d"
@@ -29,7 +30,7 @@  GOBUILDFLAGS:append = " -tags=${GO_TAGS}"
 
 export GO111MODULE="off"
 
-inherit go systemd
+inherit go update-rc.d systemd
 
 DEPENDS:append = " gzip"
 
@@ -72,7 +73,5 @@  RDEPENDS:${PN}:append = " virtual-emptty-conf pam-plugin-succeed-if"
 SYSTEMD_SERVICE:${PN} = "emptty.service"
 
 INITSCRIPT_NAME = "emptty"
-INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
+INITSCRIPT_PARAMS = "start 10 5 2 . stop 20 0 1 6 ."
 INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
-
-inherit update-rc.d systemd