Dynamic /bin support on FreeBSD 54
Dan writes "Gordon Tetlow has put together a patch to have /bin dynamically linked on FreeBSD. This is the first step on the way to having everything play nicely with ongoing work on getting NSS into the system. He cautions that the patch is preliminary and should probably be installed on a test machine."
Re:hmm talkative bunch around here (Score:5, Funny)
The linked writeup:
The message itself:
Not much more to add, is there? Except that this is the first step on the way to having everything play nicely with ongoing work on getting NSS into the system.
Re:hmm talkative bunch around here (Score:2)
Why? (Score:5, Insightful)
Re:Why? (Score:5, Informative)
NSS (name service switch) provides "on the fly" reconfigurable name services - it is the mechanism that allows (for example) a Solaris or Linux machine to look up password entries in /etc/passwd, the NIS, LDAP, or whatever, depending on the contents of the "passwd:" line of /etc/nsswitch.conf.
NSS works by dynamically loading the correct resolving routines from shared objects at run time. In contrast, a statically linked binary has "hard wired" name service lookup policies, which have been set by whatever library routines were statically linked into the executable.
A system where some of the binaries obey preferences the admin expresses through /etc/nsswitch.conf but, say, /bin/ls doesn't is unlikely to be popular! :-)
Re:Why? (Score:2)
This is, of course, not a sane justification. For example the resolver library quite happily obeys host.conf to control the same kind of decision about host name lookup dispite being statically linked into things. The highly sophistic
Re:Why? (Score:2)
If my
Re:Why? (Score:2)
How many times in the past 10 years have you desperately needed to have /bin/ls look up passwords in some bizzare new way?
If my /bin stuff is statically linked, and I install a new resolver, then what? No amount of configuration file reading is going to solve this one smart guy. I one: either have to recompile everything in /bin,[...]
I build world maybe 4 or 5 times a year. That's i
Re:Why? (Score:2)
Re:Why? (Score:2)
So, how many times in the last 10 years have you needed to have /bin/cat look up passwords in a different way:-)
Why (Score:1, Insightful)
Re:Why (Score:5, Informative)
Some of the comments at the link in the article would suggest new or improved LDAP support. That's pretty significant. NSS stands for Name Service Switch, which allows alternative datasources for many of the databases traditionally stored in
Solaris, for example, can use local files, DNS, NIS, NIS+, and LDAP for the hosts database. Minus DNS, these datasources can also provide the users database, the RBAC databases, the automounter configuration, bootparams, to name a few. To say it is useful is an understatement.
Re:Why (Score:4, Interesting)
That's good for who needs this. As for why, the NSS code works by dynamically loading the necessary backends. That's presumably why a dynamic /bin and /sbin are needed.
So, my question is, why are /bin and /sbin traditionally static? Gordon's patch pretty much just sets them to dynamic linkage, and puts some libs and rtld in /lib. I'd think that if having /bin and /sbin dynamically linked was kosher, tho, that they would be. So I'm a little worried about this patch.
Re:Why (Score:4, Informative)
Safety. When trying to repair a broken system, the dynamic linker and libraries become one less thing to worry about when the essential tools are staticly linked. I can't imagine that all the tools in
Re:Why (Score:4, Interesting)
I don't know why they needed to be completely static, as /lib still exists, so they should be linkable with libraries in there.
It's probably just a safeguard against accidentally linking to a library in /usr/lib, just to have them fail when they're most needed.
Re:Why (Score:4, Informative)
The only thing this realy gets you (other than NSS) is a smaller memory footprint at a (theoretical) cost in speed, as well as a little unsafeness in the case of one of your
And you've got to remember not to put
Re:Why (Score:5, Informative)
Re:Why (Score:5, Interesting)
Holy light bulb, Batman! (well, JDizzy, any way, to give proper credit). You've just given me an idea!!
Given that some executables are more important than others in reparing broken filesystems, this situation particularly exacerbated with crunched binaries, why not add error correcting codes to them, and use inteleaving techniques to mitigate single block errors? Yes, they would grow, but not likely to the limit of multiple complete copies.
Also, for sensitive dynamically linked libraries, perhaps the directory structure could be modified to have a common LD_LIBRARY_PATH for some system directories. Heck, never mind a mod: just make the loader sensitive to .ldpath symlinks in the directory of the executible.
Re:Why (Score:3, Insightful)
Re:Why (Score:2)
Yes, at some point, SOMETHING has to work O.K. in order for the system to boot. But, that something should be small enough and the rest reliable and redundant enough to permit the critical piece to either live in ROM, or floppy.
Thought, bootable live CD distros are handy.
Still, the one time you most desperately need to repair a sick system is also going to be the time you don't have your Swiss-
Re:Why (Score:3, Interesting)
I'm all for a really small
If things were so broken that you couldn't fix them with the various built-in ways, a "rescue disk" (aka bootable cdrom, floppy) would have to be used to moun
Re:Why (Score:3, Insightful)
This is significant in that /bin utilities are JUST A TEMPORARY HACK, and that NSSWITCH will provide modular resolver support for important stuff like gethostbyname(3) among other things. /bin doesn't mean that everything is dynamic linked! You can static link everything, and dlopen(3)
1: the dynamic
In case you haven't noticed, we need a way (LDAP?) to resolve IPSec host certificates by hostname/IP, and DNS isn't doing the job... IMHO.. other people have other reasons for wanting this.
2: dynamic linked
Re:Why (Score:2)
Re:Why (Score:2, Insightful)
The problem is sitting in front of the terminal. It's absolutely no technical problem to have a partition somewhere containing all the data you need to get you system back to life if something very integral gets lo
Re:Why (Score:1)
Bit failures are very rare when having filesystem problems. ECCs only help with (single or multiple) bit failures. They don't help if the whole block is destroyed (whi
Re:Why (Score:4, Informative)
The odd thing about FreeBSD is that dynamic libraries have rarely been a show-stopper for me.
There are two reasons for this:
The first point is self explanatory. As for their library mecahnisms: The last dozen or so times I have installed Linux, I have had to go on a treasure hunt to find exactly the right version of libc for a given application (Oracle, whatever). With FreeBSD, the old libraries can (and often are) installed and built with the system so you never have to hunt for them. Simply edit
FreeBSD libraries in make.conf also match the OS release so a 2.2 library is for a 2.2 kernel and program, etc. There is no guessing.
-sirket
Re:Why (Score:3, Informative)
Re:Why (Score:2)
Re:Why (Score:2)
Re:Why (Score:2)
Re:Why (Score:1, Informative)
$ file
$ ls -l
-r-xr-xr-x 127 root wheel 2564020 Mar 10 09:30
So we (NetBSD) impersonate 127 programs in
Re:Why (Score:2)
Re:Why (Score:2)
Re:Why (Score:2)
Re:Why (Score:2, Flamebait)
Re:Why (Score:1)
I don't know much about FreeBSD and what it's current NSS capabilities are. This could be one of those things where Linux is stronger in some things but FreeBSD stronger in others. FreeBSD has a very good reputation, so I wouldn't expect the current limitations are show-stoppers.
Re:Why (Score:2)
in a win2k domain (samba3).
Pretty odd seing windows usernames with 'ls -l' =)
Re:Why (Score:1)
Re:Why (Score:1)
I didn't know that. MacOS X 10.2 uses a similar mechanism to look up system information, like hostnames, printers, users, groups, mountpoints. The information can reside in BSD-like
NSS = nsswitch (Score:1, Informative)
"NSSwitch support -- Jacques Vidrine (nectar@) --
Support for pluggable directory services using NSS, including adaptations of current directory services (local databases, NIS), and support for new services (LDAP, Active Directory, etc). This change has been committed, and requires broader testing."
One thing I had noticed that in -current I had to use nsswitch.conf to have it use dns rather than looking up m
Debate over dynamic /bin (Score:3, Informative)