/bin And /sbin Now Dynamically Linked In FreeBSD
Dan writes "Gordon Tetlow just committed a patch in FreeBSD current to change /bin and /sbin from statically to dynamically linked. The reason to do this is two-fold. This feature brings support for loadable PAM and NSS modules to base system utilities located in those directories. It also reduces the storage requirements for the root filesystem due to the use of shared libraries. This feature can be disabled in a buildworld by defining the Makefile (make.conf) variable WITHOUT_DYNAMICROOT. Note that statically-linked, crunched executables are available in the /rescue directory for use during system repair and recovery operations."
why not? /rescue/bin/mv /rescue/bin* /bin
etc.
I'm still somewhat surprised that this got committed now, shouldn't 5.2 be released Really Soon Now? This looks like something that ought to be tested in -CURRENT for a good while.
Programming can be fun again. Film at 11.
Programming can be fun again. Film at 11.
Of course it is.
/bin && /sbin binaries are treated in a release as significant as FreeBSD, is definitely news for nerds, stuff that matters.
/sbin has been a significant issue in Unix-user/-admin land for many, many years. This change now sets in place a new scheme for administrators to understand and work around - with the new linking flag, admins can set up systems in new and interesting ways.
... and thus, this *IS* important news for slashdot.
...
How the
The static nature of
Any FreeBSD admin who now doesn't understand the reasoning and potential problems of this new linking scheme will *definitely* need to learn it and understand it if they want to continue doing a good admin job in the future.
One good way to learn about this and use it is to read the comments from slashdot readers about this issue
Just because SCO/MICROSOFT/LINUX isn't in the article, doesn't mean its not important
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
One of the main advantages of this is that you can replace libraries with security loopholes without having to rebuild everything. There have been several cases of bugs in the standard libraries that have required the statically compiled programs in /bin to be rebuilt.
I thought *nix was designed as:
/ - minimum required to boot and repair system
If your system ever became damaged, you booted to / and fixed it. If / is too large, then audit what's in there and make sure it contains the bare minimum required.
Adding /rescue is unnecessarily cluttering up the system.
M-x ispell-buffer
If not, how does this differ?
The difference is that the Amiga is dead, while FreeBSD is alive, well and kicking. FreeBSD could have done this way back in 1.0, but there was no pressing need to. In the immortal words of some anonymous software designer: "don't prematurely optimize."
Don't blame me, I didn't vote for either of them!
How often do you have a libc upgrade fail, though
In FreeBSD, never. In Linuxland, everytime GNU bumps the minor version of glibc. To be fair, the upgrade works fine. It's just that everything else on the system breaks.
Don't blame me, I didn't vote for either of them!
I thought one of the reasons we have /sbin is so that we can run the binaries there without having dynamic libraries involved.
/sbin statically-linked, anyway?
Reasons being:
1) Size: Running in single-user mode or small kernels that don't use dynamically-linked libraries.
2) Security: No risk of library-path-based security exploits.
Am I missing something here? Why isn't
Kris
Kriston
You don't understand the post. The point is not that FreeBSD is going boldly into the 80s with dynamic linking, it's that the default world now has binaries living in /bin and /sbin as dynamic instead of static. For a long time they were all static linked because of recovery issues. Now they are dynamically linked (with an option to be static if you're paranoid). They probably link against only stuff in /lib which will be on the root partition. Anything in /usr/lib would be dangerous if /usr was toasted - your shell would go bye bye.
okay, maybe it's just me, and maybe I'm wrong. But I was under the impression that /bin /sbin's primary reason for existance was the same hole this /rescue directory will be filling? And how does it use LESS space (as if space were an issue anymore compared to speed in which case static is USUALLY, not always, better anyway), to simply move the static versions of the binaries in /bin and /sbin to /rescue and add dynamic versions to /bin and /sbin.
/rescue now becomes as fundementally critical as /bin and /sbin have been before it certainly counts as part of the base system. If you move the static binaries, and add something, isn't that BIGGER than just the static binaries?
Since
I wonder if anyone screaming about what a HORRIBLE idea this is and how it will cause cancer in kittens, has actually tried it? Obviously the FreeBSD developers are not dumb, and root will always be able to get on to use /rescue, and the advantages are a lot more sophisticated than just saving some space on the root partition.
It's pretty knee-jerk to scream about it if you don't actually know how it's been implemented.
J
Actually, no. Dynamically linked binaries are slower than statically linked ones.
(8-DCS)