summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2010-01-22 22:36:40 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2010-01-23 08:47:07 +0100
commit1b4f7c479cbd6489a626051674f9def7446872d7 (patch)
tree71e6693bd90159c4b31dd7f44a7b1a10a00ece08 /package
parent750f684c7f0117b16adc02c28d1c329958c2b470 (diff)
pdnsd review: add init-file and sample config
Diffstat (limited to 'package')
-rw-r--r--package/pdnsd/Makefile4
-rw-r--r--package/pdnsd/files/pdnsd.conf30
-rw-r--r--package/pdnsd/files/pdnsd.conffiles1
-rw-r--r--package/pdnsd/files/pdnsd.init31
-rw-r--r--package/pdnsd/files/pdnsd.postinst3
5 files changed, 68 insertions, 1 deletions
diff --git a/package/pdnsd/Makefile b/package/pdnsd/Makefile
index 4c454a332..aea5877f9 100644
--- a/package/pdnsd/Makefile
+++ b/package/pdnsd/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:= pdnsd
PKG_VERSION:= 1.2.7
-PKG_RELEASE:= 1
+PKG_RELEASE:= 2
PKG_MD5SUM:= 114b3b21b09b43cbfcccdde726b84c12
PKG_DESCR:= Proxy DNS server with permanent caching
PKG_SECTION:= net
@@ -24,6 +24,8 @@ BUILD_STYLE:= auto
INSTALL_STYLE:= auto
post-install:
+ $(INSTALL_DIR) $(IDIR_PDNSD)/etc
+ ${INSTALL_DATA} ./files/pdnsd.conf ${IDIR_PDNSD}/etc/
$(INSTALL_DIR) $(IDIR_PDNSD)/usr/sbin
$(INSTALL_BIN) $(WRKINST)/usr/sbin/pdnsd{,-ctl} $(IDIR_PDNSD)/usr/sbin/
diff --git a/package/pdnsd/files/pdnsd.conf b/package/pdnsd/files/pdnsd.conf
new file mode 100644
index 000000000..00b548117
--- /dev/null
+++ b/package/pdnsd/files/pdnsd.conf
@@ -0,0 +1,30 @@
+global {
+ perm_cache=1024;
+ cache_dir="/var/cache/pdnsd"; # do not change this!
+ run_as="nobody";
+ server_ip = 127.0.0.1; # Use eth0 here if you want to allow other
+ # machines on your network to query pdnsd.
+ status_ctl = on;
+# paranoid=on; # This option reduces the chance of cache poisoning
+ # but may make pdnsd less efficient, unfortunately.
+ query_method=udp_tcp;
+ min_ttl=15m; # Retain cached entries at least 15 minutes.
+ max_ttl=1w; # One week.
+ timeout=10; # Global timeout option (10 seconds).
+}
+
+server {
+ label= "myisp";
+ ip = 192.168.0.1; # Put your ISP's DNS-server address(es) here.
+# proxy_only=on; # Do not query any name servers beside your ISP's.
+ # This may be necessary if you are behind some
+ # kind of firewall and cannot receive replies
+ # from outside name servers.
+ timeout=4; # Server timeout; this may be much shorter
+ # that the global timeout option.
+ uptest=if; # Test if the network interface is active.
+ interface=eth0; # The name of the interface to check.
+ interval=10m; # Check every 10 minutes.
+ purge_cache=off; # Keep stale cache entries in case the ISP's
+ # DNS servers go offline.
+}
diff --git a/package/pdnsd/files/pdnsd.conffiles b/package/pdnsd/files/pdnsd.conffiles
new file mode 100644
index 000000000..c2ae46acb
--- /dev/null
+++ b/package/pdnsd/files/pdnsd.conffiles
@@ -0,0 +1 @@
+/etc/pdnsd.conf
diff --git a/package/pdnsd/files/pdnsd.init b/package/pdnsd/files/pdnsd.init
new file mode 100644
index 000000000..0da77186d
--- /dev/null
+++ b/package/pdnsd/files/pdnsd.init
@@ -0,0 +1,31 @@
+#!/bin/sh
+#PKG pdnsd
+#INIT 60
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${pdnsd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/pdnsd.conf ] || exit
+ mkdir -p /var/cache/pdnsd
+ pdnsd -s -t -d
+ ;;
+stop)
+ pkill pdnsd
+ ;;
+restart)
+ sh $0 stop
+ sleep 1
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/pdnsd/files/pdnsd.postinst b/package/pdnsd/files/pdnsd.postinst
new file mode 100644
index 000000000..4d63fd712
--- /dev/null
+++ b/package/pdnsd/files/pdnsd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf pdnsd pdnsd NO