[Resolvconf-devel] Question about implementation

Thomas Hood jdthood at yahoo.co.uk
Wed Feb 22 15:15:05 UTC 2006


Identity Guarded wrote:
> I was interested in implementing something for local use similar to what you 
> do with the /etc/resolvconf/run symlink linking 
> to /dev/shm/resolvconf.  /dev/shm is volatile, though, isn't it?


Yes.


> I can't 
> quite find where /dev/shm/resolvconf is set up upon a system startup.


It is created in /etc/init.d/resolvconf.


> I don't think it's done in /etc/init.d/resolvconf because of the following 
> expression in line 56:
> 
> RUN_CANONICALDIR="$(readlink -f "$RUN_DIR")"
> 
> Because of the -f switch, a broken run symlink would elicit an empty string 
> from readlink, which would cause /etc/init.d/resolvconf to exit out with an 
> error message.


Because the PATH includes "/lib/init" as the first element, "readlink" runs
/lib/init/readlink rather than /bin/readlink.  /lib/init/readlink is a custom
version of the readlink program which implements the old (i.e., pre-woody)
"tolerant" behaviour of returning a value even if the target of the symlink
does not exist.  The current "intolerant" behaviour of /bin/readlink is to
fail to return any value of the target of the symlink does not exist.

/lib/init/readlink is included in the initscripts package temporarily until
version 5.9x of coreutils makes it into testing.  In the latter versions of
the coreutils package, "readlink -f" implements the "tolerant" behaviour
again and "readlink -e" implements "intolerant" behaviour.

-- 
Thomas Hood



More information about the Resolvconf-devel mailing list