Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train should be using /etc/os-release for all Linux os detection #685

Open
tas50 opened this issue May 11, 2021 · 1 comment
Open

train should be using /etc/os-release for all Linux os detection #685

tas50 opened this issue May 11, 2021 · 1 comment

Comments

@tas50
Copy link
Contributor

tas50 commented May 11, 2021

Linux long ago moved to using /etc/os-release for all operating system information. We moved Chef to this several years ago with Ohai and it's been a great success. We no longer have to add every new operating system as they're released and instead we just use the OS data that comes from /etc/os-release automatically. For our legacy platform names we do a simple remap and for everything new we just use the value out of /etc/os-release. Train should be using this same logic so we can settle on a single detection path and so we don't have to add every new distro to train:

https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/platform.rb

@tas50 tas50 changed the title inspec should be using /etc/os-release for all Linux os detection train should be using /etc/os-release for all Linux os detection Jul 27, 2021
@tas50
Copy link
Contributor Author

tas50 commented Oct 8, 2021

Here's a list of all the files and commands we're running to check the OS. This is pointless and slow

[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = uname -s
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = uname -m
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/debian_version
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/os-release && cat /etc/os-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /usr/bin/FastCli
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = show version | json
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/lsb-release && cat /etc/lsb-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /usr/bin/lsb-release && cat /usr/bin/lsb-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/oracle-release && cat /etc/oracle-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/enterprise-release && cat /etc/enterprise-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/parallels-release && cat /etc/parallels-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/system-release && cat /etc/system-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/redhat-release && cat /etc/redhat-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/SuSE-release && cat /etc/SuSE-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/arch-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/slackware-version && cat /etc/slackware-version
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/gentoo-release && cat /etc/gentoo-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/exherbo-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/alpine-release && cat /etc/alpine-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/coreos/update.conf
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] root@172.16.1.1 cmd = test -f /etc/issue && cat /etc/issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant