diff options
author | Ermal <eri@pfsense.org> | 2010-03-29 14:07:05 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-03-29 14:07:05 +0000 |
commit | de63d61d87a69b595425eea801fd0a30d255a469 (patch) | |
tree | 219648add020db5038f683d668f2940d16e34a32 /config/tinydns | |
parent | 56619cc2b97abef4248ea2058fe17c814c20238d (diff) | |
download | pfsense-packages-de63d61d87a69b595425eea801fd0a30d255a469.tar.gz pfsense-packages-de63d61d87a69b595425eea801fd0a30d255a469.tar.bz2 pfsense-packages-de63d61d87a69b595425eea801fd0a30d255a469.zip |
Ticket #403. More improvements from patches provided here.
Diffstat (limited to 'config/tinydns')
-rw-r--r-- | config/tinydns/tinydns.inc | 31 | ||||
-rw-r--r-- | config/tinydns/tinydns.xml | 8 |
2 files changed, 32 insertions, 7 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index ba616846..de4ea302 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -111,8 +111,6 @@ svscan_start () { svscan_stop_post () { echo "Stopping svscan." find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 /usr/local/bin/svc -dx - PIDTOKILL=`cat /var/run/ping_hosts.pid` - kill $PIDTOKILL } run_rc_command "\$1" @@ -121,12 +119,33 @@ EOD; fwrite($fd, $svscan); fclose($fd); - conf_mount_ro(); - filter_configure(); + $filename = "tinydns.sh"; + $start = "/usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDPHP +<?php + require_once(\"/usr/local/pkg/tinydns.inc\"); tinydns_custom_php_changeip_command(); - - exec("/usr/local/etc/rc.d/svscan.sh start"); + tinydns_create_zone_file(); + tinydns_setup_ping_items(); +?> +ENDPHP\n"; + + $stop = <<<ENDSH + svc -dx /var/run/service/tinydns + /bin/rm -f /var/run/service/tinydns + PIDTOKILL=`cat /var/run/ping_hosts.pid` + kill \$PIDTOKILL +ENDSH; + + write_rcfile(array( + "file" => $filename, + "start" => $start, + "stop" => $stop + ) + ); + + conf_mount_ro(); + filter_configure(); } function tinydns_custom_php_deinstall_command() { diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml index a6720179..1eb5b1eb 100644 --- a/config/tinydns/tinydns.xml +++ b/config/tinydns/tinydns.xml @@ -57,8 +57,14 @@ <url>/tinydns_status.php</url> </menu> <service> - <name>DNS Server</name> + <name>svscan</name> <rcfile>svscan.sh</rcfile> + <executable>svscan</executable> + <description>Daemontools service directory watcher</description> + </service> + <service> + <name>DNS Server</name> + <rcfile>tinydns.sh</rcfile> <executable>tinydns</executable> <description>TinyDNS DNS Server</description> </service> |