Bug 3805 - PAM support: missing pam_systemd.so
Summary: PAM support: missing pam_systemd.so
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-01-29 11:20 UTC by Yi Zhao
Modified: 2013-09-25 12:40 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Zhao 2013-01-29 11:20:08 UTC
Tree/Branch: poky/master
Git Rev: 8d6e55bf2192524bda84138b5356a2791adbbe61

When build an image with pam support, there is a error message with missing pam_systemd.so

Steps:
##############
1. Add DISTRO_FEATURES_append = " pam" to conf/local.conf and build the image.
2. Boot up the image and check the /var/log/message
##############


#############
Jan 29 11:13:41 qemuppc authpriv.err login[438]: PAM unable to dlopen(/lib/security/pam_systemd.so): /lib/security/pam_systemd.so: cannot open shared object file: No such file or di    rectory
231 Jan 29 11:13:41 qemuppc authpriv.err login[438]: PAM adding faulty module: /lib/security/pam_systemd.so
#############
Comment 1 Ross Burton 2013-01-30 12:03:09 UTC
Hm, I thought pam would silently handle that.

Clearly that change needs to be conditional on the systemd distro feature.
Comment 2 Radu Moisan 2013-01-31 09:46:56 UTC
I checked and indeed the library is missing, however I could not reproduce the same way, with my current setup (pulled master yesterday) it breaks gconf complaining about the same thing.

I also tried my systemd branch, which has the systemd.bbclass and it works, so I'm chasing that lead now.
Comment 3 Ross Burton 2013-01-31 10:07:23 UTC
The problem is that pam_systemd only exists in systemd distros, but the pam configuration always refers to it.  I was under the impression that pam would silently handle optional pam modules without error, but that doesn't appear to be the case.

The systemd reference in the pam configuration needs to be conditional on the systemd feature, or truly optional.

Actually, pam.conf says:

"If the type value from the list above is prepended with a - character the PAM library will not log to the system log if it is not possible to load the module because it is missing in the system. This can be useful especially for modules which are not always installed on the system and are not required for correct authentication and authorization of the login session."

Sounds ideal.
Comment 4 Radu Moisan 2013-01-31 10:12:26 UTC
ok, missed the part where systemd was disabled.
Looking into pam then.
Comment 5 Radu Moisan 2013-02-01 09:42:19 UTC
I could initially reproduce this, but could not anymore after Thursday morning pull.
Comment 6 Yi Zhao 2013-02-06 09:50:37 UTC
I can reproduce it with latest master branch:
git rev: ee1f126ad5cb2c6af66815e55720257a1efc5a49

Steps:
##############
1. Add DISTRO_FEATURES_append = " pam" to conf/local.conf and build the image.
2. Boot up the image and check the /var/log/message
##############

Check the message log, I can see the following error:
###############
Feb  6 09:03:29 qemux86 authpriv.err passwd[822]: PAM unable to dlopen(/lib/security/pam_systemd.so): /lib/security/pam_systemd.so: cannot open shared object file: No such file or directory
Feb  6 09:03:29 qemux86 authpriv.err passwd[822]: PAM adding faulty module: /lib/security/pam_systemd.so
###############
Comment 7 Radu Moisan 2013-02-13 13:18:35 UTC
(In reply to comment #6)
> I can reproduce it with latest master branch:
> git rev: ee1f126ad5cb2c6af66815e55720257a1efc5a49
> 
> Steps:
> ##############
> 1. Add DISTRO_FEATURES_append = " pam" to conf/local.conf and build the
> image.
> 2. Boot up the image and check the /var/log/message
> ##############
> 
> Check the message log, I can see the following error:
> ###############
> Feb  6 09:03:29 qemux86 authpriv.err passwd[822]: PAM unable to
> dlopen(/lib/security/pam_systemd.so): /lib/security/pam_systemd.so: cannot
> open shared object file: No such file or directory
> Feb  6 09:03:29 qemux86 authpriv.err passwd[822]: PAM adding faulty module:
> /lib/security/pam_systemd.so
> ###############

please dump here the output for "systemctl --version"
Comment 8 Radu Moisan 2013-02-14 09:33:38 UTC
I can't reproduce.
I checked that systemd is compiled with pam support and it is. The pam_systemd.so is in it's place and in consequence there is not error message trying to load the library.

Please confirm.
Comment 9 Yi Zhao 2013-02-19 03:10:22 UTC
(In reply to comment #8)
> I can't reproduce.
> I checked that systemd is compiled with pam support and it is. The
> pam_systemd.so is in it's place and in consequence there is not error
> message trying to load the library.
> 
> Please confirm.

Hi Radu,

I made a mistake. I didn't set the init manager to systemd in local.conf. After added the line DISTRO_FEATURES_INITMAN ?= "systemd" in local.conf, the error message disappeared. But if we don't use systemd, the pam still want to load pam_systemd.so, is this a bug ? Do we need to fix it ?
Comment 10 Radu Moisan 2013-02-19 08:14:29 UTC
Ok, then I'll give a shot to what Ross was suggesting.
Comment 11 Radu Moisan 2013-02-20 09:59:28 UTC
(In reply to comment #9)

> Hi Radu,
> 
> I made a mistake. I didn't set the init manager to systemd in local.conf.
> After added the line DISTRO_FEATURES_INITMAN ?= "systemd" in local.conf, the
> error message disappeared. But if we don't use systemd, the pam still want
> to load pam_systemd.so, is this a bug ? Do we need to fix it ?

I've tried this morning a clean build on master with sysvinit enabled (and pam). I could not find any warning/error message in logs with regard to pam_systemd.so or anything related to systemd for that matter.
Comment 12 Radu Moisan 2013-02-22 12:37:13 UTC
same on my side.
Comment 13 Yi Zhao 2013-02-26 12:04:12 UTC
(In reply to comment #11)
> (In reply to comment #9)
> 
> > Hi Radu,
> > 
> > I made a mistake. I didn't set the init manager to systemd in local.conf.
> > After added the line DISTRO_FEATURES_INITMAN ?= "systemd" in local.conf, the
> > error message disappeared. But if we don't use systemd, the pam still want
> > to load pam_systemd.so, is this a bug ? Do we need to fix it ?
> 
> I've tried this morning a clean build on master with sysvinit enabled (and
> pam). I could not find any warning/error message in logs with regard to
> pam_systemd.so or anything related to systemd for that matter.

Which image type do you test ? The issue happens on sato and sato-sdk image.
Comment 14 Radu Moisan 2013-02-26 12:08:42 UTC
tried sato.
Comment 15 Yi Zhao 2013-02-26 12:23:20 UTC
DISTRO_FEATURES_append = " pam"

There must be a space between " and pam

I tried qemuarm, still have this issue.
Comment 16 Yi Zhao 2013-03-26 06:07:25 UTC
This issue still happens on master: 9ffee9add2d0380f4025e7a678a166f25a7d659e

Reopen it.
Comment 17 Radu Moisan 2013-03-29 11:09:04 UTC
asked QA to take a look over
Comment 18 Radu Moisan 2013-04-02 09:10:15 UTC
gave another try today, sato and sato-sdk

Build Configuration:
BB_VERSION        = "1.17.1"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.3+snapshot-20130402"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:92aeb31341b28b193d616ab5cf38af1b9673e37d"

run both images in quemu and grep'd for systemd in /var/log/messages, nothing came up.

@Yi Zhao: Please don't reopen this, let QA team to give it a try, and if they can't please work with them until they do, assuming this is a valid bug.
Comment 19 Ross Burton 2013-04-03 11:57:50 UTC
I can replicate.  The key is that this only happens on sysvinit images.
Comment 20 Radu Moisan 2013-04-03 16:19:34 UTC
(In reply to comment #19)
> I can replicate.  The key is that this only happens on sysvinit images.

so a clean build with systemd disabled should do it, right?
Comment 21 Ross Burton 2013-04-03 16:24:31 UTC
Yep, or an autobuilt image.  Annoying prefixing the pam line with - doesn't seem to work, this machine I just tried it on won't start X anymore.
Comment 22 Alexandru Palalau 2013-04-11 12:18:56 UTC
Could not reproduce on master branch, commit ID: fe336b149552b1f4f24d979c40302653298b98cc
Comment 23 Radu Moisan 2013-05-13 13:19:11 UTC
tried again following builds (core-image-sato) (clean builds)

Build Configuration:
BB_VERSION        = "1.19.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.3+snapshot-20130513"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:f7afeeb75993b159bb8959e0309bc5eb3978a8fb"

Build Configuration:
BB_VERSION        = "1.19.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "powerpc-poky-linux"
MACHINE           = "qemuppc"
DISTRO            = "poky"
DISTRO_VERSION    = "1.3+snapshot-20130513"
TUNE_FEATURES     = "m32 fpu-hard ppc603e"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:f7afeeb75993b159bb8959e0309bc5eb3978a8fb"
Comment 24 Ross Burton 2013-09-19 10:43:12 UTC
Still happening:

Sep 19 11:31:54 genericx86 login[1329]: PAM unable to dlopen(/lib/security/pam_systemd.so): /lib/security/pam_systemd.so: cannot open shared object file: No such file or directory

Will investigate.
Comment 25 Ross Burton 2013-09-19 15:03:32 UTC
Patch sent to oe-core.
Comment 26 Ross Burton 2013-09-24 15:18:52 UTC
Merged in oe-core 3ccb0855a7a6b147e5025855c6376747ba72986a.
Comment 27 Alexandru Palalau 2013-09-25 12:40:47 UTC
Verified in master branch.
Commit ID: 4d8ab87d25ea6e59dc88375813ef88ee0ac813d0
No errors in /var/log/messages.