package/polkit: install service file
PATCH 1/4 package/polkit: install service file
From: Adam Duskett <[email protected]>
The default installed service file is missing a target, which causes preset-all to not enable the service.
Add the service file to package/polkit with the addition of:
[Install]
WantedBy=multi-user.target
--- package/polkit/polkit.mk | 6 ++++++ package/polkit/polkit.service | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 package/polkit/polkit.service
package/polkit/polkit.mk +6 -0
@@ -43,4 +43,10 @@ define POLKIT_PERMISSIONS /usr/bin/pkexec f 4755 root root - - - - - endef +define POLKIT_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 $(POLKIT_PKGDIR)/polkit.service \ + $(TARGET_DIR)/usr/lib/systemd/system/polkit.service + +endef + $(eval $(autotools-package))
package/polkit/polkit.service new file +12 -0
@@ -0,0 +1,12 @@ +[Unit] + +Description=Authorization Manager +Documentation=man:polkit(8) + +[Service] +Type=dbus +BusName=org.freedesktop.PolicyKit1 +ExecStart=/usr/lib/polkit-1/polkitd --no-debug + +[Install] +WantedBy=multi-user.target
Signature · 1 line
2.25.2
PATCH 2/4 package/polkit: add upstream memory leak fix
From: Adam Duskett <[email protected]>
This patch fixes two small memory leaks.
Upstream commit: 28e3a6653d8c3777b07e0128a0d97d46e586e311
--- package/polkit/0002-jsauthority-memleak.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/polkit/0002-jsauthority-memleak.patch
package/polkit/0002-jsauthority-memleak.patch new file +28 -0
@@ -0,0 +1,28 @@ +From 28e3a6653d8c3777b07e0128a0d97d46e586e311 Mon Sep 17 00:00:00 2001 +From: Jan Rybar <[email protected]> +Date: Tue, 8 Oct 2019 13:28:18 +0000 +Subject: [PATCH] jsauthority: Fix two minor memory leaks + +(cherry picked from commit 28e3a6653d8c3777b07e0128a0d97d46e586e311) +Signed-off-by: Jan Rybar <[email protected]> +Signed-off-by: Adam Duskett <[email protected]> +--- + src/polkitbackend/polkitbackendjsauthority.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp +index 9b752d1..e97b8aa 100644 +--- a/src/polkitbackend/polkitbackendjsauthority.cpp ++++ b/src/polkitbackend/polkitbackendjsauthority.cpp +@@ -567,6 +567,8 @@ polkit_backend_js_authority_finalize (GObject *object) + g_strfreev (authority->priv->rules_dirs); + + delete authority->priv->ac; ++ delete authority->priv->js_global; ++ delete authority->priv->js_polkit; + + JS_DestroyContext (authority->priv->cx); + /* JS_ShutDown (); */ +-- +2.24.1 +
Signature · 1 line
2.25.2
PATCH 2/4 package/polkit: add upstream memory leak fix
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"aduskett" == aduskett <[email protected]> writes:
From: Adam Duskett <[email protected]>
This patch fixes two small memory leaks.Upstream commit:
28e3a6653d8c3777b07e0128a0d97d46e586e311Signed-off-by Adam Duskett <[email protected]>
Committed to 2020.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/4 package/polkit: add upstream fix for SIGTTOU
In reply to aduskett at gmail.comFrom: Adam Duskett <[email protected]>
If tty_handler() resets terminal while pkttyagent is run in background job, the process gets stopped by SIGTTOU. This impacts systemctl, hence it must be blocked for a while and then the process gets killed anyway.
Upstream commit: 28e3a6653d8c3777b07e0128a0d97d46e586e311
--- ...lkit-0.116-pkttyagent-sigttou-bg-job.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch
package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 76aae4fce586b400f5fe08df31497db19d624609 Mon Sep 17 00:00:00 2001 +From: Jan Rybar <[email protected]> +Date: Thu, 1 Aug 2019 06:46:10 +0000 +Subject: [PATCH] pkttyagent: process stopped by SIGTTOU if run in background + job + + +(cherry picked from commit 76aae4fce586b400f5fe08df31497db19d624609) +Signed-off-by: Jan Rybar <[email protected]> +Signed-off-by: Adam Duskett <[email protected]> +--- + src/programs/pkttyagent.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c +index 3c8d502..13879a2 100644 +--- a/src/programs/pkttyagent.c ++++ b/src/programs/pkttyagent.c +@@ -264,6 +264,12 @@ main (int argc, char *argv[]) + + memset (&sa, 0, sizeof (sa)); + sa.sa_handler = &tty_handler; ++/* If tty_handler() resets terminal while pkttyagent is run in background job, ++ the process gets stopped by SIGTTOU. This impacts systemctl, hence it must ++ be blocked for a while and then the process gets killed anyway. ++ */ ++ sigemptyset(&sa.sa_mask); ++ sigaddset(&sa.sa_mask, SIGTTOU); + sigaction (SIGTERM, &sa, &savesigterm); + sigaction (SIGINT, &sa, &savesigint); + sigaction (SIGTSTP, &sa, &savesigtstp); +-- +2.24.1 +
Signature · 1 line
2.25.2
PATCH 3/4 package/polkit: add upstream fix for SIGTTOU
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"aduskett" == aduskett <[email protected]> writes:
From: Adam Duskett <[email protected]>
Iftty_handler()resets terminal while pkttyagent is run in background job, the process gets stopped by SIGTTOU. This impacts systemctl, hence it must be blocked for a while and then the process gets killed anyway.Upstream commit:
28e3a6653d8c3777b07e0128a0d97d46e586e311Signed-off-by Adam Duskett <[email protected]>
Committed to 2020.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 4/4 package/polkit: enable gobject-introspection support
In reply to aduskett at gmail.comFrom: Adam Duskett <[email protected]>
If gobject-introspection is selected, add the gobject-introspection package to the dependency list and set the conf opt --enable-introspection.
--- package/polkit/polkit.mk | 7 +++++++ 1 file changed, 7 insertions(+)
package/polkit/polkit.mk +7 -0
@@ -26,6 +26,13 @@ POLKIT_CONF_OPTS = \ --disable-libelogind \ --disable-libsystemd-login +ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) +POLKIT_CONF_OPTS += --enable-introspection +POLKIT_DEPENDENCIES += gobject-introspection +else +POLKIT_CONF_OPTS += --disable-introspection +endif + ifeq ($(BR2_PACKAGE_LINUX_PAM),y) POLKIT_DEPENDENCIES += linux-pam POLKIT_CONF_OPTS += --with-authfw=pam
Signature · 1 line
2.25.2
PATCH 1/4 package/polkit: install service file
In reply to aduskett at gmail.comQuoted 10 lines · On Fri, 17 Apr 2020 19:58:13 -0700 aduskett at gmail.com wrote:
From: Adam Duskett <[email protected]>
The default installed service file is missing a target, which causes preset-all to not enable the service.
Add the service file to package/polkit with the addition of:
[Install]
WantedBy=multi-user.target
Quoted 6 lines
Signed-off-by Adam Duskett <[email protected]>--- package/polkit/polkit.mk | 6 ++++++ package/polkit/polkit.service | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 package/polkit/polkit.service
I've applied the series. However, I hesitated to apply PATCH 1/4:
upstream provides a service file so it would be better to be able to use it. Could you report to upstream the missing [Install] section in the .service file ?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/4 package/polkit: install service file
In reply to aduskett at gmail.comQuoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"aduskett" == aduskett <[email protected]> writes:
From: Adam Duskett <[email protected]>
The default installed service file is missing a target, which causes preset-all to not enable the service.
Quoted 6 lines
Add the service file to package/polkit with the addition of:
[Install]
WantedBy=multi-user.targetSigned-off-by Adam Duskett <[email protected]>
Committed to 2020.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard