Skip to contentSkip to conversation

Pamela.py can't run on BMC python env

DISCUSSION xiuzhi 2 participants 3 messages Nov 15, 2018 – Nov 16, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

xiuzhi

author
#1 lore raw

Hi All,
I want to use PAM python module pamela.py in the /usr/lib/python2.7/site-packages .
The error is as follows :

1)root@haiguang1:/usr/lib/python2.7/site-packages# python -m pamela -a `whoami`
Could not import runpy module
2)root@haiguang1:/usr/lib/python2.7/site-packages# python ./pamela.py
Traceback (most recent call last):
  File "./pamela.py", line 143, in <module>
    PAM_START = LIBPAM.pam_start
  File "/usr/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 384, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python: undefined symbol: pam_start

I run the pamela.py on ubuntu16.04 ,it work very well. Who can give me some suggestions?

Best,
Xiuzhi

#2 lore raw

Hello Xiuzhi,

pamela.py depends on the libpam library and find_library is failing. A workaround is up for review.

https://gerrit.openbmc-project.xyz/#/c/openbmc/meta-phosphor/+/13092/

Regards,
Tom

Quoted 21 lines · xiuzhi

Hi All,
   I want to use PAM python module pamela.py  in the /usr/lib/python2.7/site-packages . The error is as follows :

1)root@haiguang1:/usr/lib/python2.7/site-packages# python -m pamela -a `whoami`
Could not import runpy module
2)root@haiguang1:/usr/lib/python2.7/site-packages# python ./pamela.py
Traceback (most recent call last):
  File "./pamela.py", line 143, in <module>
    PAM_START = LIBPAM.pam_start
  File "/usr/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 384, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python: undefined symbol: pam_start

I run the pamela.py on ubuntu16.04 ,it work very well. Who can give me some suggestions?

Best,
Xiuzhi

author
#3 lore raw

Hi Tom,
Pamela.py works now,thanks very much.
Best,
Xiuzhi

------------------ Original ------------------

From:  "Tom Joseph";<[email protected]>;
Date:  Nov 15, 2018
To:  "xiuzhi"<[email protected]>; "openbmc"<[email protected]>; 

Cc: "ratagupt"<[email protected]>;
Subject: Re: Pamela.py can't run on BMC python env

Hello Xiuzhi,

pamela.py depends on the libpam library and find_library is failing. A workaround is up for review.

https://gerrit.openbmc-project.xyz/#/c/openbmc/meta-phosphor/+/13092/

Regards,
Tom

Quoted 23 lines · xiuzhi

Hi All,
I want to use PAM python module pamela.py in the
/usr/lib/python2.7/site-packages .
The error is as follows :

1)root@haiguang1:/usr/lib/python2.7/site-packages# python -m pamela -a 
`whoami`
Could not import runpy module
2)root@haiguang1:/usr/lib/python2.7/site-packages# python ./pamela.py
Traceback (most recent call last):
  File "./pamela.py", line 143, in <module>
    PAM_START = LIBPAM.pam_start
  File "/usr/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 384, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python: undefined symbol: pam_start

I run the pamela.py on ubuntu16.04 ,it work very well. Who can give me some suggestions?

Best,
Xiuzhi