HewlettPackard / python-redfish-utility

Python-based utility for interacting with devices supporting a Redfish Service
Other
85 stars 41 forks source link

Cannot open self /usr/sbin/ilorest or archive /usr/sbin/ilorest.pkg #11

Closed sw-elling closed 2 years ago

sw-elling commented 5 years ago

A day after installing ilorest via the RPM package on a Linux system, running ilorest results in the following:

$ ilorest --version
Cannot open self /usr/sbin/ilorest or archive /usr/sbin/ilorest.pkg

The Linux system in question is running prelink and the problem is caused by a bug in pyinstaller (pyinstaller/pyinstaller#1812), which has been fixed.

To work around this issue, the ilorest path was added to prelink's blacklist.

# echo '-b /usr/sbin/ilorest' > /etc/prelink.conf.d/ilorest.conf

The steps taken to demonstrate the problem were:

$ ls -l /etc/cron.daily/prelink
-rwxr-xr-x 1 root root 2126 Jul 19  2013 /etc/cron.daily/prelink

$ rpm -qa ilorest
ilorest-2.3.4-1.x86_64

$ cp -av /usr/sbin/ilorest /tmp/
`/usr/sbin/ilorest' -> `/tmp/ilorest'

$ /tmp/ilorest --version
RESTful Interface Tool 2.3

$ sudo /usr/sbin/prelink -mR -q /tmp/ilorest

$ /tmp/ilorest --version
Cannot open self /tmp/ilorest or archive /tmp/ilorest.pkg
Yergidy commented 5 years ago

Thanks for the submit. We are aware of this issue and it will be fixed in the next release.

Yergidy commented 5 years ago

@sw-elling Hi, We have released iLOrest 2.4.1. This should fix the prelink issue as we build with a different pyinstaller version.

sw-elling commented 5 years ago

Problem is still present with iLOrest 2.4.1.

$ lsb_release -ds
"CentOS release 6.8 (Final)"

$ sudo yum update ilorest-2.4.1-14.x86_64.rpm
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Update Process
Examining ilorest-2.4.1-14.x86_64.rpm: ilorest-2.4.1-14.x86_64
Marking ilorest-2.4.1-14.x86_64.rpm as an update to ilorest-2.3.4-1.x86_64
[...]
Resolving Dependencies
--> Running transaction check
---> Package ilorest.x86_64 0:2.3.4-1 will be updated
---> Package ilorest.x86_64 0:2.4.1-14 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

[...]

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : ilorest-2.4.1-14.x86_64     1/2
warning: /etc/ilorest/redfish.conf saved as /etc/ilorest/redfish.conf.rpmsave
  Cleanup    : ilorest-2.3.4-1.x86_64     2/2
  Verifying  : ilorest-2.4.1-14.x86_64     1/2
  Verifying  : ilorest-2.3.4-1.x86_64     2/2

Updated:
  ilorest.x86_64 0:2.4.1-14
$ rpm -ql ilorest | grep bin/
/usr/sbin/ilorest

$ cp -av /usr/sbin/ilorest /tmp/
`/usr/sbin/ilorest' -> `/tmp/ilorest'

$ /tmp/ilorest --version
RESTful Interface Tool 2.4

$ sudo /usr/sbin/prelink -mR -q /tmp/ilorest

$ /tmp/ilorest --version
Cannot open self /tmp/ilorest or archive /tmp/ilorest.pkg
$ rpm-extract-contents.sh ilorest-2.4.1-14.x86_64.rpm
mkdir: created directory `/tmp/ilorest-2.4.1-14.x86_64'
./etc/ilorest
./etc/ilorest/redfish.conf
./usr/lib64/ilorest_chif.so
./usr/sbin/ilorest
./usr/share/man/man8/ilorest.8.gz
16947 blocks

$ /tmp/ilorest-2.4.1-14.x86_64/usr/sbin/ilorest --version
RESTful Interface Tool 2.4

$ sudo /usr/sbin/prelink -mR -q /tmp/ilorest-2.4.1-14.x86_64/usr/sbin/ilorest

$ /tmp/ilorest-2.4.1-14.x86_64/usr/sbin/ilorest --version
Cannot open self /tmp/ilorest-2.4.1-14.x86_64/usr/sbin/ilorest or archive /tmp/ilorest-2.4.1-14.x86_64/usr/sbin/ilorest.pkg
Yergidy commented 5 years ago

@sw-elling Sorry for the slow response. This is indeed a pyinstaller bug. As a workaround you can blacklist the iLOrest binary from prelinking. Performing something similar to the below command should work: # echo "-b /usr/sbin/ilorest" > /etc/prelink.conf.d/ilorest.conf

sw-elling commented 4 years ago

I'm no longer supporting HPE hardware so do what you want with this issue.

saabi-hu commented 4 years ago

This issue is still exists. OS: RHEL 6.10 ilorest: 3.01

rajeevkallur commented 3 years ago

Is this still issue with version 3.2.2?

sahanaramavana commented 2 years ago

Hi @saabi-hu ,

Kindly verify with iLORest 3.3.0 , we verified the same at our end and we couldnt get the error .

Thanks & Regards, iLORest Team

jp-villette commented 2 years ago

Hello,

No, the issue still exist with ilorest 3.3.0 and 3.5.0 :

[root]# ilorest -V RESTful Interface Tool 3.5.0.0 [root]# prelink -a [root]# ilorest -v [12966] Cannot open self /usr/sbin/ilorest or archive /usr/sbin/ilorest.pkg

JPV

sahanaramavana commented 2 years ago

Hi @jp-villette ,

Sure . we will verify

Meanwhile what is the purpose behind prelinking here . iLORest being a smaller application we got this question in our mind .

Thanks for your support and help in investigation .

Thanks & Regards, iLORest Team

jp-villette commented 2 years ago

Hello,

No purpose at all. Here iLOrest is installed on 2000 servers essentially for update purpose. It is rarely used except during the update campaigns.

The best option actually is to create an exception in prelink. For us, it would be a good idea to add the code to create this exception directly when we install the tool as we know if PRELINK is active, the ilorest can't be used.

And don't forget to document officially this limitation. ;-)

Thanks in advance. JPV

sahanaramavana commented 2 years ago

Hi @jp-villette ,

Thanks for all the insights on this . We will document this .

And also we are having a enhancement request raised in system for future release to have a enablement done w.r.t .

Thanks for support .

Thanks & Regards, iLORest Team