Skip to content

CloudLinux VM not recognized #240

Description

@adamjstewart

I've encountered a CloudLinux VM that distro is unable to recognize:

$ distro
Name: 
Version: 
Codename: 
$ python -c 'import distro; print(distro.linux_distribution())'
('', '', '')

The problem is that none of the normal search strategies work:

$ which lsb_release
/usr/bin/which: no lsb_release in (...)
$ ls /etc/*release
ls: cannot access /etc/*release: No such file or directory
$ ls /etc/*version
ls: cannot access /etc/*version: No such file or directory
$ uname -a
Linux web.illinois.edu 3.10.0-962.3.2.lve1.5.24.9.el7.x86_64 #1 SMP Wed Feb 13 08:24:50 EST 2019 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/version
Linux version 3.10.0-962.3.2.lve1.5.24.9.el7.x86_64 (mockbuild@buildfarm02.cloudlinux.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Wed Feb 13 08:24:50 EST 2019

The only strategy that seems to work is:

$ hostnamectl
   Static hostname: web.illinois.edu
         Icon name: computer-vm
           Chassis: vm
           Boot ID: 5b5b8c522ccd4974808f192aea001491
    Virtualization: kvm
  Operating System: CloudLinux 7.6 (Vladimir Lyakhov)
       CPE OS Name: cpe:/o:cloudlinux:cloudlinux:7.6:GA:server
            Kernel: Linux 3.10.0-962.3.2.lve1.5.24.9.el7.x86_64
      Architecture: x86-64

We may need to add another search strategy to support this type of VM.

Activity

  1. HorlogeSkynet commented on Feb 5, 2022

    @HorlogeSkynet
    Member

    Hey @adamjstewart, do you know where the CPE is provisioned in such an environment ?
    Thanks, bye 👋

  2. adamjstewart commented on Feb 5, 2022

    @adamjstewart
    ContributorAuthor

    What is a CPE?

  3. HorlogeSkynet commented on Feb 6, 2022

    @HorlogeSkynet
    Member

    Common Platform Enumeration, look at hostnamectl output.
    I'll do some research on my own soon.

  4. adamjstewart commented on Feb 6, 2022

    @adamjstewart
    ContributorAuthor

    Hostnamectl output is attached above. Is there something else you need from me?

  5. HorlogeSkynet commented on Feb 6, 2022

    @HorlogeSkynet
    Member

    So we are looking for OperatingSystemPrettyName and OperatingSystemCPEName D-Bus attributes (see sources).

    If we can manage to fetch them without reading from the bus (maybe they are provisioned on the file system too ?), we could then implement a trivial CPE parser and extract information from there.

  6. adamjstewart commented on Feb 6, 2022

    @adamjstewart
    ContributorAuthor

    I recursively grepped the entire OS for those strings but didn't find anything useful. Maybe it would be easier to build a hostnamectl parser?

  7. HorlogeSkynet commented on Feb 6, 2022

    @HorlogeSkynet
    Member

    Thanks for trying this.
    hostnamectl --json=short could make this straightforward.

    Maybe we are missing something, and others got a better idea ?
    Another way would be to read from D-Bus directly... A Python dependency is required though.
    See you 👋

  8. adamjstewart commented on Feb 6, 2022

    @adamjstewart
    ContributorAuthor

    This version of hostnamectl doesn't have a --json option.

  9. HorlogeSkynet commented on Feb 8, 2022

    @HorlogeSkynet
    Member

    So re.search around hostnamectl output, or something like dcar if we want to stop calling binaries directly in the future.

  10. NebularNerd commented on Aug 20, 2024

    @NebularNerd

    Coming to join the conversation here as my issue #368 was basically a duplicate.

    Happy to help test any potential solutions on my GoDaddy CloudLinux 8 server. As discussed in my issue hostnamectl is not available in that environment.

  11. HorlogeSkynet commented on Aug 20, 2024

    @HorlogeSkynet
    Member

    Hello again @NebularNerd !

    We can start by checking whether the above "D-Bus way" works in your environment too.

    bustctl is another systemd binary but if you have it, could you run : busctl get-property org.freedesktop.hostname1 /org/freedesktop/hostname1 org.freedesktop.hostname1 OperatingSystemPrettyName ?
    If it isn't, could you give a try to dbus-send --system --print-reply --dest=org.freedesktop.hostname1 /org/freedesktop/hostname1 org.freedesktop.DBus.Properties.Get string:org.freedesktop.hostname1 string:OperatingSystemPrettyName ?

    Thanks ! Bye 👋

  12. NebularNerd commented on Aug 20, 2024

    @NebularNerd

    Hello again @NebularNerd !

    We can start by checking whether the above "D-Bus way" works in your environment too.

    bustctl is another systemd binary but if you have it, could you run : busctl get-property org.freedesktop.hostname1 /org/freedesktop/hostname1 org.freedesktop.hostname1 OperatingSystemPrettyName ? If it isn't, could you give a try to dbus-send --system --print-reply --dest=org.freedesktop.hostname1 /org/freedesktop/hostname1 org.freedesktop.DBus.Properties.Get string:org.freedesktop.hostname1 string:OperatingSystemPrettyName ?

    Thanks ! Bye 👋

    Hi @HorlogeSkynet 🙂

  13. HorlogeSkynet commented on Aug 20, 2024

    @HorlogeSkynet
    Member

    What a shame... I wonder whether we should opt for a simpler approach like checking for /usr/sbin/cloudlinux-selector presence, and hope for upstream to properly include an os-release (or any other indicative) file. What do you think ? 🙄

    Note : this wouldn't give us the version, nor the "pretty name".


    EDIT : if we wanna stick to the D-Bus way (and if we cannot manage to directly retrieve what D-Bus queries), we have to come up with a first Python script to dialog with D-Bus if you don't have any system tool to do so 🤡

  14. 9 remaining items

  15. HorlogeSkynet commented on Aug 22, 2024

    @HorlogeSkynet
    Member

    Hello @NebularNerd ! Could you please take a look/give a try to #369 RFC ? 🙂
    Thanks bye 👋

  16. NebularNerd commented on Aug 22, 2024

    @NebularNerd

    Tested #369 on the GoDaddy 🥔 server and we have a winner 🎉

    {
        "codename": "",
        "id": "cloudlinux",
        "like": "",
        "version": "8",
        "version_parts": {
            "build_number": "",
            "major": "8",
            "minor": ""
        }
    }
    
  17. HorlogeSkynet commented on Aug 22, 2024

    @HorlogeSkynet
    Member

    Awesome, we only have to wait for @python-distro/maintainers to properly review #369 then 🙂
    Many thanks for your time and resources Andy, see you 👋

  18. added this to the v1.11.0 milestone on Aug 22, 2024
  19. added a commit that references this issue on Dec 30, 2024
    ec93f04
  20. added 5 commits that reference this issue on Nov 1, 2025
    494ed7b
    777b134
    8ed5508
    bfa1566
    532a3dd
  21. adamjstewart commented on Nov 10, 2025

    @adamjstewart
    ContributorAuthor
  22. adamjstewart commented on Nov 10, 2025

    @adamjstewart
    ContributorAuthor

    @HorlogeSkynet I think it would be wise to adopt an official policy of only fixing bugs for versions of OSes that are still supported. That can easily end a lot of debates.

  23. HorlogeSkynet commented on Nov 10, 2025

    @HorlogeSkynet
    Member

    I think it would be wise to adopt an official policy of only fixing bugs for versions of OSes that are still supported. That can easily end a lot of debates.

    I second that.

    1. prefer redirecting to upstream distributions patches, to honor existing datasources and their format
    2. downstream (simple) patches for non-EOL distributions

    For reference, this issues was partially related to #262.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions