All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Duskett <aduskett@gmail.com>
To: buildroot@buildroot.org
Cc: Marek Belisko <marek.belisko@open-nandra.com>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Giulio Benetti <giulio.benetti@benettiengineering.com>,
	Norbert Lange <nolange79@gmail.com>,
	Adam Duskett <aduskett@gmail.com>,
	Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Subject: [Buildroot] [PATCH v2 2/4] package/polkit/S50polkit: new file
Date: Wed, 21 Jul 2021 14:45:16 -0700	[thread overview]
Message-ID: <20210721214518.227254-2-aduskett@gmail.com> (raw)
In-Reply-To: <20210721214518.227254-1-aduskett@gmail.com>

The Polkit source does not come with non-systemd init script. Add one that is
modeled after package/busybox/S01syslogd.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 package/polkit/S50polkit | 51 ++++++++++++++++++++++++++++++++++++++++
 package/polkit/polkit.mk |  5 ++++
 2 files changed, 56 insertions(+)
 create mode 100755 package/polkit/S50polkit

diff --git a/package/polkit/S50polkit b/package/polkit/S50polkit
new file mode 100755
index 0000000000..38cb463b8a
--- /dev/null
+++ b/package/polkit/S50polkit
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+DAEMON="polkitd"
+DAEMON_PATH="/usr/lib/polkit-1/${DAEMON}"
+PIDFILE="/var/run/${DAEMON}.pid"
+POLKITD_ARGS="--no-debug"
+
+# polkitd does not create a pidfile, so pass "-n" in the command line
+# and use "-m" to instruct start-stop-daemon to create one.
+start() {
+  printf 'Starting %s: ' "${DAEMON}"
+  # shellcheck disable=SC2086 # we need the word splitting
+  start-stop-daemon -bmSqp "$PIDFILE" -x ${DAEMON_PATH} -- ${POLKITD_ARGS}
+  status=$?
+  if [ "$status" -eq 0 ]; then
+    echo "OK"
+  else
+    echo "FAIL"
+  fi
+  return "$status"
+}
+
+stop() {
+  printf 'Stopping %s: ' "${DAEMON}"
+  start-stop-daemon -Kqp "$PIDFILE"
+  status=$?
+  if [ "$status" -eq 0 ]; then
+    rm -f "$PIDFILE"
+    echo "OK"
+  else
+    echo "FAIL"
+  fi
+  return "$status"
+}
+
+restart() {
+  stop
+  sleep 1
+  start
+}
+
+case "$1" in
+  start|stop|restart|reload)
+    "$1";;
+  reload)
+    # Restart, since there is no true "reload" feature.
+    restart;;
+  *)
+    echo "Usage: $0 {start|stop|restart|reload}"
+    exit 1
+esac
diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk
index f48c103a52..d5b3955ddb 100644
--- a/package/polkit/polkit.mk
+++ b/package/polkit/polkit.mk
@@ -57,4 +57,9 @@ define POLKIT_INSTALL_INIT_SYSTEMD
 
 endef
 
+define POLKIT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/polkit/S50polkit \
+		$(TARGET_DIR)/etc/init.d/S50polkit
+endef
+
 $(eval $(autotools-package))
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

  reply	other threads:[~2021-07-21 21:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 21:45 [Buildroot] [PATCH v2 1/4] package/polkit: bump version to 0.119 and use duktape Adam Duskett
2021-07-21 21:45 ` Adam Duskett [this message]
2021-08-05  9:46   ` [Buildroot] [PATCH v2 2/4] package/polkit/S50polkit: new file Peter Korsgaard
2021-07-21 21:45 ` [Buildroot] [PATCH v2 3/4] support/testing: add polkit tests Adam Duskett
2021-07-21 21:45 ` [Buildroot] [PATCH v2 4/4] package/spidermonkey: drop package Adam Duskett
2021-07-24 21:30 ` [Buildroot] [PATCH v2 1/4] package/polkit: bump version to 0.119 and use duktape Thomas Petazzoni

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=20210721214518.227254-2-aduskett@gmail.com \
    --to=aduskett@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=marek.belisko@open-nandra.com \
    --cc=maxime.hadjinlian@gmail.com \
    --cc=nolange79@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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.