Hacker News new | ask | show | jobs
by chasil 866 days ago
Interestingly, Oracle does not remove the /etc/redhat-release file.

That would be an interesting fight.

2 comments

Rocky Linux has /etc/redhat-release as well. Reason being that some software checks that file for version / compatibility information, and we want to avoid breaking it. (They should be checking /etc/os-release, but it is what it is.)
There's actually a (very silly) reason for not removing /etc/redhat-release. There's many applications out there that rely on that file's existence, even if it's just a symlink to the proper file. Some apps use this as a way to figure out "what kind of system" it is (e.g. is it a red hat like system?) or as a way to figure out what the system is and version it is running. It's a bit annoying, as sometimes these apps either read it or they don't, so it's inconsistent.

It gets even more weird when you consider /etc/os-release has better information (in my opinion) then the {redhat,system}-release file would ever provide. There's also the random situations where if redhat-release doesn't exist, an app may look for system-release and do some sort of parsing to figure it out (again, ignoring os-release) and may get it wrong.

That's part of why you'll find Oracle Linux, CentOS Stream, Fedora Linux, and even us with /etc/redhat-release existing as a symlink to our own. I find it to be the odd bandaid to something that shouldn't be a problem, but sometimes life just isn't straightforward.