| From: John Jordan <[EMAIL PROTECTED]>
| Right now I am workingn on creating a hard link between
| /etc/resolv.conf and the one in chroot.
Beware: depending on how /etc/resolv.conf is updated, the hard link
may be left pointing at crap. If *I* were updating resolve.conf, I'd
slap it into place with a mv. The reason: that would make the
transition "atomic" (i.e. either done or not done as far as any
observer can see -- as opposed to half-done). But that means that any
hard link will be left pointing at the old file.
But remember: I didn't write the /etc/resolv.conf updater. You may
have to test to see if a hard link works as you hope.
The obvious cure is to use a symlink. Unfortunately, that won't work
from a chroot environment.
| Someone told me to create
| a hard link by doing this, but the syntax doesn't quite work:
|
| ln /etc/resolv.conf /chroot/breezy/32bits/etc/resolv.conf
|
| It says the file already exists. I read the man page on ln and it gave
| a lot of information about options, but nowhere did it say exactly
| what ln DOES. But don't get me started on Linux documentation. :(
I like UNIX-style documentation ("man pages"). Linux has adopted several
conventions, partially, so the resulting mish-mash is rather uneven.
UNIX-style man pages are terse. Leaving much to the creativity of the
reader. This is good, if you can handle them.
I don't know how much you know of the UNIX (Linux) file-system
abstraction. Here is a quick summary.
(1) there are files (note: a file itself has no name)
(2) each file has a set of permissions
(3) some files are directories
(4) directories contain a set of name and file reference pairs.
Each name can then be used to designate a file.
(These references are represented as "inode numbers" and cannot
reach between filesystems)
(5) each directory can be named by only one name reference
(this questionable rule prevents the filesystem being anything
other than a tree)
(6) any other file can have any number of name references
(7) a file is freed when nothing can use it any more:
the last name reference is gone and no program has the
file open.
This all seems obvious but it is actually subtle. It leads to some
surprises. For example, each file can have several ways of
referencing it, and none is any more important/official/real than
another.
"rm x" does not delete a file. It deletes a name reference. Only if
it is the last one, and no program has the file open, will the file
will be freed. Perhaps the name of the corresponding system call is
clearer: unlink(2).
"mv /a/b/c /x/y/z" really only deletes one name reference and creates
a new one (if there already was an /x/y/z, that name reference is
rm'ed first to make room for the new one). No file contents are
moved. As a convenience, mv will notice when the source and
destination are on different filesystems and do its job a different
way; this was not the case when I first used UNIX (1975).
"ln /a/b/c /x/y/z" is just like mv, except
- the source name is not deleted
- the destination name must not already exist
(unless you use "-f")
- there is no support for a ln between filesystems.
This corresponds to the link(2) system call.
ln is actually more fundamental than mv. The mv program was
originally implemented using link(2) and unlink(2) system calls.
Later a rename(2) system call was added to the kernel and is now used
by mv.
So the file that is referenced as /etc/resolv.conf could also be
referenced as /chroot/breezy/32bits/etc/resolv.conf. That's what you
are trying to do.
The command you gave would work just fine if there were not already a
reference /chroot/breezy/32bits/etc/resolv.conf
Because the name is already used, just add -f to the command.
_______________________________________________
LinuxR3000 mailing list
[email protected]
http://lists.pcxperience.com/cgi-bin/mailman/listinfo/linuxr3000
Wiki at http://prinsig.se/weekee/