glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
250 stars 61 forks source link

Error Install on Alma Linux 9 #527

Closed renatosetubal closed 1 year ago

renatosetubal commented 1 year ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Yes, I know

Describe the bug

Found distro: RedHat
Running on linux distro: AlmaLinux release 9.2 (Turquoise Kodkod) : RedHat : 9.2...
Installing glpi-agent v1.5...
Trying to install glpi-agent v1.5-1 on AlmaLinux release 9.2 (Turquoise Kodkod) release (RedHat:9.2)...
Extracting glpi-agent-1.5-1.noarch.rpm ...
Checking codeready-builder-for-rhel-9-x86_64-rpms repository repository is enabled
Running: subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms
Can't exec "subscription-manager": No such file or directory at /opt/MPES/glpi-installer.pl line 652.

To reproduce

perl /tmp/glpi-agent-1.5-linux-installer.pl -s $SERVER --tag $(hostname -s) --httpd-trust=127.0.0.1/32 --no-ssl-check -l /tmp -Q -v

Expected behavior

I excpected the agent installed

Operating system

Linux

GLPI Agent version

1.5

GLPI version

10.0.9

GLPIInventory plugin or FusionInventory for GLPI plugin version

GLPI Inventory v1.2.3

Additional context

I must to force use Centos to solve.

g-bougard commented 1 year ago

Hello @renatosetubal

in theory, AlmaLinux is still supported, but in your case, it seems the installer detects a RedHat and not an AlmaLinux distro name.

As a work-around, can you try to bypass the detection by adding the following option --distro almalinux ?

Of course, we should tune the detection to avoid using --distro option. For that, can you check if the following files exists on the computer and then share its content ?

Can you also check if any other file finishing with -release exists in /etc folder (ls /ety/*-release) and share its content if you find one ?

renatosetubal commented 1 year ago

Hello Friend, I´v tried to do like you said and returned this error:

[root@AL09 ~]# perl /tmp/glpi-agent-1.5-linux-installer.pl -s myserver.local --tag $(hostname -s) --httpd-trust=127.0.0.1/32 --distro almalinux --force --runnow --no-ssl-check -l /tmp -Q -v Found distro: RedHat Unsupported AlmaLinux release 9.2 (Turquoise Kodkod) linux distribution (almalinux:9.2)

In this case, i run the same command with --distro centos and worked well. On Alma 8 I have no problem.

g-bougard commented 1 year ago

Okay, can you share the files I requested ?

P.S.: I still have a patch to support almalinux for --force option

renatosetubal commented 1 year ago

/etc/os-release:

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"

/etc/almalinux-release:

AlmaLinux release 9.2 (Turquoise Kodkod)

/etc/redhat-release:

AlmaLinux release 9.2 (Turquoise Kodkod)
g-bougard commented 1 year ago

As usual, some people decided to no more follow an established standard. This time this is in AlmaLinux team and I don't thank them... Here, that people removed NAME, VERSION & PRETTY_NAME variables from os-release file.

So I've to update the installer to look for REDHAT_SUPPORT_PRODUCT & REDHAT_SUPPORT_PRODUCT_VERSION in os-release file. This may help to support other redhat based distro anyway.

g-bougard commented 1 year ago

Hi @renatosetubal

next nightly built perl linux installer should support your distro without requiring --force option.

Thank you again for your contribution.