[Resolvconf-devel] Bug#426275: resolvconf: add script to update proxy and other services
Anon Sricharoenchai
anon.hui at gmail.com
Sun May 27 16:19:30 UTC 2007
Package: resolvconf
Version: 1.15
Severity: wishlist
Tags: patch
I have written the script that was primarily used to update the list of
current valid proxy servers. However, it has later been generalized to
be capable of updating server addresses for other services, such as,
smtp server or any other types.
Those servers are updated base on the contents in resolv.conf (that is
/etc/resolvconf/run/interface/*). The file /etc/resolvconf/proxy.conf
will contain the mapping from those resolv.conf contents to the
specified servers for each service (proxy, smtp, etc.).
/etc/resolvconf/proxy.conf:
# This will map the resolv.conf value to the servers for each service.
# <type> <val> <service>:[(tcp|udp)/]<host>[:<port>] <service>:... ...
search example.com proxy:tcp/10.0.0.10:8080 proxy:10.0.0.11:8080
search example.com proxy:proxy1.example.com proxy:proxy2.example.com:8080
search example.com smtp:smtp.example.com:25
search home proxy:10.10.10.1:8080
nameserver 10.10.10.1 proxy:10.10.10.1:8080 smtp:10.10.10.1:25
Note that, the services are not limited to only proxy and smtp. The
arbitrary service name can be added.
According to the above proxy.conf, when resolv.conf is updated, and if
it finally contains the entry like "search example.com" and
"nameserver 10.10.10.1", the script /etc/resolvconf/update.d/proxy will
then collect all corresponding service servers, that is,
tcp/10.0.0.10:8080
10.0.0.11:8080
proxy1.example.com
proxy2.example.com:8080
10.10.10.1:8080
for proxy service (the sort order will corresponding to
/lib/resolvconf/list-records), and
smtp.example.com:25
10.10.10.1:25
for smtp service. The list of these servers will be passed to the
scripts in /etc/resolvconf/update-proxy.d and
/etc/resolvconf/update-smtp.d, respectively. It is passed to the
command line arguments as follow,
$ run-parts --arg=tcp/10.0.0.10:8080 --arg=10.0.0.11:8080 \
--arg=proxy1.example.com --arg=proxy2.example.com:8080 \
--arg=10.10.10.1:8080 /etc/resolvconf/update-proxy.d
$ run-parts --arg=smtp.example.com:25 --arg=10.10.10.1:25 \
/etc/resolvconf/update-smtp.d
== Usage summary ==
$ /etc/resolvconf/update.d/proxy [-i]
config:
/etc/resolvconf/proxy.conf
/etc/resolvconf/update-proxy.d
/etc/resolvconf/update-smtp.d
/etc/resolvconf/update-<service>.d
output:
/etc/resolvconf/run/service/proxy
/etc/resolvconf/run/service/smtp
/etc/resolvconf/run/service/<service>
$ run-parts [--arg=-i] --arg=<host>:<port> --arg=<host>:<port> ... \
/etc/resolvconf/update-proxy.d
$ run-parts [--arg=-i] --arg=<host>:<port> /etc/resolvconf/update-smtp.d
$ run-parts [--arg=-i] ... /etc/resolvconf/update-<service>.d
== squid proxy example ==
The attach files, also include the file
"/etc/resolvconf/update-proxy.d/squid" as an example to show how it has
been adapted to configure the parent proxy peer in squid.
-- System Information:
Debian Release: testing/unstable
Architecture: i386 (i686)
Kernel: Linux 2.6.10-5-386
Locale: LANG=C, LC_CTYPE=thai
Versions of packages resolvconf depends on:
ii debconf [debconf-2.0] 1.4.29ubuntu4 Debian configuration management sy
ii initscripts 2.85-22ubuntu12 Standard scripts needed for bootin
-- debconf information excluded
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resolvconf.tgz
Type: application/x-gzip
Size: 7588 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/resolvconf-devel/attachments/20070527/c9fc3d13/attachment.bin
More information about the Resolvconf-devel
mailing list