diff mbox series

[v6,5/6] package/polkit: add init service file

Message ID 20191206234649.3972927-5-aduskett@gmail.com
State Rejected, archived
Headers show
Series [v6,1/6] package/polkit: bump to version 0.116 | expand

Commit Message

Adam Duskett Dec. 6, 2019, 11:46 p.m. UTC
From: Adam Duskett <Aduskett@gmail.com>

Add a S50polkit file which starts polkit for non-systemd based systems.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
Changes v1 -> v5:
 - Use start-stop-daemon in the init file. (Thomas)
 - Reorder this patch in the series.

 package/polkit/S50polkit | 15 +++++++++++++++
 package/polkit/polkit.mk |  5 +++++
 2 files changed, 20 insertions(+)
 create mode 100644 package/polkit/S50polkit

Comments

Thomas Petazzoni Dec. 8, 2019, 3:08 p.m. UTC | #1
Hello,

+Carlos in Cc for the review of the init script.

On Fri,  6 Dec 2019 15:46:48 -0800
aduskett@gmail.com wrote:

> diff --git a/package/polkit/S50polkit b/package/polkit/S50polkit
> new file mode 100644
> index 0000000000..55c10e99ae
> --- /dev/null
> +++ b/package/polkit/S50polkit
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +#
> +# start polkitd
> +#
> +
> +case "$1" in
> +	start)
> +		start-stop-daemon -q -S -x /usr/lib/polkit-1/polkitd -- --no-debug &

Why is the & necessary at this end ?

I think this init script deserves a comment that explains why it
doesn't follow the traditional pattern for init scripts.

Thanks!

Thomas
Carlos Santos Feb. 9, 2020, 9:28 p.m. UTC | #2
On Sun, Dec 8, 2019 at 12:08 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> +Carlos in Cc for the review of the init script.
>
> On Fri,  6 Dec 2019 15:46:48 -0800
> aduskett@gmail.com wrote:
>
> > diff --git a/package/polkit/S50polkit b/package/polkit/S50polkit
> > new file mode 100644
> > index 0000000000..55c10e99ae
> > --- /dev/null
> > +++ b/package/polkit/S50polkit
> > @@ -0,0 +1,15 @@
> > +#!/bin/sh
> > +#
> > +# start polkitd
> > +#
> > +
> > +case "$1" in
> > +     start)
> > +             start-stop-daemon -q -S -x /usr/lib/polkit-1/polkitd -- --no-debug &
>
> Why is the & necessary at this end ?
>
> I think this init script deserves a comment that explains why it
> doesn't follow the traditional pattern for init scripts.
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Why is a polkitd init script requited if, according to the man page

DESCRIPTION
       polkitd provides the org.freedesktop.PolicyKit1 D-Bus service
       on the system message bus. Users or administrators should never
       need to start this daemon as it will be automatically started
       by dbus-daemon(1) or systemd(1) whenever an application calls
       into the service.
diff mbox series

Patch

diff --git a/package/polkit/S50polkit b/package/polkit/S50polkit
new file mode 100644
index 0000000000..55c10e99ae
--- /dev/null
+++ b/package/polkit/S50polkit
@@ -0,0 +1,15 @@ 
+#!/bin/sh
+#
+# start polkitd
+#
+
+case "$1" in
+	start)
+		start-stop-daemon -q -S -x /usr/lib/polkit-1/polkitd -- --no-debug &
+		;;
+	*)
+  echo "Usage: $0 {start}"
+		exit 1
+esac
+
+exit $?
diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk
index b440cd2f1c..8bb4512aee 100644
--- a/package/polkit/polkit.mk
+++ b/package/polkit/polkit.mk
@@ -44,4 +44,9 @@  define POLKIT_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/polkit.service
 endef
 
+define POLKIT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/polkit/S50polkit \
+		$(TARGET_DIR)/etc/init.d/S50polkit
+endef
+
 $(eval $(autotools-package))