Ver Fonte

pdnsd review: add init-file and sample config

Phil Sutter há 14 anos atrás
pai
commit
1b4f7c479c

+ 3 - 1
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/
 

+ 30 - 0
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.
+}

+ 1 - 0
package/pdnsd/files/pdnsd.conffiles

@@ -0,0 +1 @@
+/etc/pdnsd.conf

+ 31 - 0
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 $?

+ 3 - 0
package/pdnsd/files/pdnsd.postinst

@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf pdnsd pdnsd NO