All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit branch/next] package/seatd: install init scripts
@ 2021-05-18 17:09 Yann E. MORIN
  0 siblings, 0 replies; only message in thread
From: Yann E. MORIN @ 2021-05-18 17:09 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=60cee128c7282353d11c538a26abad709f3d3701
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/next

Add commands to the seatd package to install the systemd unit included
in the source tarball and a SysV init script, and ensure that the
"video" group gets created.

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
[yann.morin.1998 at free.fr:
  - model the init script after package/busybox/S01syslogd
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/seatd/S70seatd | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 package/seatd/seatd.mk | 15 +++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/package/seatd/S70seatd b/package/seatd/S70seatd
new file mode 100755
index 0000000000..32bdc40fbb
--- /dev/null
+++ b/package/seatd/S70seatd
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+DAEMON="seatd"
+DAEMON_EXE="/usr/bin/${DAEMON}"
+PIDFILE="/run/${DAEMON}.pid"
+
+start() {
+	printf 'Starting %s: ' "${DAEMON}"
+	start-stop-daemon -S -x "${DAEMON_EXE}" -p "${PIDFILE}" -m -b -- -g video
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo OK
+	else
+		echo FAIL
+	fi
+	return "$status"
+}
+
+stop() {
+	printf 'Stopping %s: ' "${DAEMON}"
+	start-stop-daemon -K -x "${DAEMON_EXE}" -p "${PIDFILE}"
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo OK
+	else
+		echo FAIL
+	fi
+	return "$status"
+}
+
+restart() {
+	stop
+	sleep 1
+	start
+}
+
+case "${1}" in
+	start|stop|restart)
+		"${1}";;
+	reload)
+		restart;;
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+		;;
+esac
diff --git a/package/seatd/seatd.mk b/package/seatd/seatd.mk
index 2e90270555..2abcefbfaa 100644
--- a/package/seatd/seatd.mk
+++ b/package/seatd/seatd.mk
@@ -30,6 +30,21 @@ endif
 
 ifeq ($(BR2_PACKAGE_SEATD_DAEMON),y)
 SEATD_CONF_OPTS += -Dseatd=enabled -Dserver=enabled
+
+define SEATD_USERS
+	- - video -1 - - - - -
+endef
+
+define SEATD_INSTALL_INIT_SYSV
+	$(INSTALL) -m 0755 -D $(SEATD_PKGDIR)/S70seatd \
+		$(TARGET_DIR)/etc/init.d/S70seatd
+endef
+
+define SEATD_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -m 0644 -D $(@D)/contrib/systemd/seatd.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/seatd.service
+endef
+
 else
 SEATD_CONF_OPTS += -Dseatd=disabled -Dserver=disabled
 endif

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-18 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 17:09 [Buildroot] [git commit branch/next] package/seatd: install init scripts Yann E. MORIN

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.