aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-01-28 05:36:04 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-01-28 05:36:04 +0000
commit0b63bddea6e695528ec10a4df14855d071a6fd59 (patch)
tree65c8066873d5621e1167d963bdf3e38fc5a3aee4
parent41c779aaa7763b2e7f6412b4b5af9ebdcf1ac37e (diff)
downloadpfsense-packages-0b63bddea6e695528ec10a4df14855d071a6fd59.tar.gz
pfsense-packages-0b63bddea6e695528ec10a4df14855d071a6fd59.tar.bz2
pfsense-packages-0b63bddea6e695528ec10a4df14855d071a6fd59.zip
Use minicron since cron seems to stop running ping_hosts.sh after about 100 runs. Not sure what is going on with CRON but I am out of time of chasing its bad habits.
-rw-r--r--packages/tinydns/tinydns.inc20
-rw-r--r--packages/tinydns/tinydns.xml6
2 files changed, 3 insertions, 23 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index ed024680..4ee32325 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -88,11 +88,14 @@ svscan_start () {
/usr/bin/env \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
/usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &" > /dev/null
+ minicron 1 /var/run/ping_hosts.pid /etc/ping_hosts.sh
}
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"
@@ -132,23 +135,6 @@ function tinydns_custom_php_changeip_command() {
exec("/usr/local/bin/tinydns-conf Gtinydns Gdnslog /etc/tinydns {$ip}");
exec("/bin/mkdir /service");
exec("/bin/ln -s /etc/tinydns /service/");
- if($updatecron) {
- $text_1 = "*/1 * * * * root /etc/ping_hosts.sh";
- $text_5 = "*/5 * * * * root /etc/ping_hosts.sh";
- $filenamea = "/etc/crontab";
- remove_text_from_file($filenamea, $text_1);
- remove_text_from_file($filenamea, $text_5);
- add_text_to_file($filenamea, $text_1);
- } else {
- $text_1 = "*/1 * * * * root /etc/ping_hosts.sh";
- $text_5 = "*/5 * * * * root /etc/ping_hosts.sh";
- $filenamea = "/etc/crontab";
- remove_text_from_file($filenamea, $text_1);
- remove_text_from_file($filenamea, $text_5);
- add_text_to_file($filenamea, $text_5);
- }
-
- exec("killall -HUP cron");
conf_mount_ro();
filter_configure();
}
diff --git a/packages/tinydns/tinydns.xml b/packages/tinydns/tinydns.xml
index bc7e2c40..864859b9 100644
--- a/packages/tinydns/tinydns.xml
+++ b/packages/tinydns/tinydns.xml
@@ -82,12 +82,6 @@
<type>input</type>
</field>
<field>
- <fieldname>updatecron</fieldname>
- <fielddescr>Update cron</fielddescr>
- <description>Changes cron to ping hosts every minute from 5.</description>
- <type>checkbox</type>
- </field>
- <field>
<fieldname>syncxmlrpc</fieldname>
<fielddescr>XMLRPC Sync</fielddescr>
<description>Sync TinyDNS configuration to backup firewalls</description>