Patchwork libpam: only use pam_systemd.so if systemd is enabled

login
register
mail settings
Submitter Ross Burton
Date Sept. 19, 2013, 3:03 p.m.
Message ID <1379603001-6995-1-git-send-email-ross.burton@intel.com>
Download mbox | patch
Permalink /patch/58385/
State Accepted
Commit fc91e068cc38f8990571526c723292ad03b5c2d4
Headers show

Comments

Ross Burton - Sept. 19, 2013, 3:03 p.m.
So that sysvinit images don't warn on every login only add it to common-session
if systemd is a DISTRO_FEATURE.

[ YOCTO #3805 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-extended/pam/libpam/pam.d/common-session |    2 --
 meta/recipes-extended/pam/libpam_1.1.6.bb             |    4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-extended/pam/libpam/pam.d/common-session b/meta/recipes-extended/pam/libpam/pam.d/common-session
index 7fd61fe..a4a551f 100644
--- a/meta/recipes-extended/pam/libpam/pam.d/common-session
+++ b/meta/recipes-extended/pam/libpam/pam.d/common-session
@@ -17,5 +17,3 @@  session	requisite			pam_deny.so
 session	required			pam_permit.so
 # and here are more per-package modules (the "Additional" block)
 session	required	pam_unix.so
-# Register with logind to make screen/tmux/etc work
-session	optional	pam_systemd.so
diff --git a/meta/recipes-extended/pam/libpam_1.1.6.bb b/meta/recipes-extended/pam/libpam_1.1.6.bb
index 448a67b..f7493c5 100644
--- a/meta/recipes-extended/pam/libpam_1.1.6.bb
+++ b/meta/recipes-extended/pam/libpam_1.1.6.bb
@@ -102,6 +102,10 @@  do_install() {
 
 	# The lsb requires unix_chkpwd has setuid permission
 	chmod 4755 ${D}${sbindir}/unix_chkpwd
+
+	if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
+	fi
 }
 
 python do_pam_sanity () {