aboutsummaryrefslogtreecommitdiffstats
path: root/config/cron
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-04-06 16:49:16 -0600
committermcrane <mctch@yahoo.com>2009-04-06 16:49:16 -0600
commit7dd374f607fd71775bae43d0ac17c4e97495b8aa (patch)
tree65e628ac4db9b90cac662631541233f3a7d740e1 /config/cron
parent34791a81ef20f06aeb93fc84243c346da984bbd6 (diff)
downloadpfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.tar.gz
pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.tar.bz2
pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.zip
Cron package monitor process
Diffstat (limited to 'config/cron')
-rw-r--r--config/cron/cron.inc31
-rw-r--r--config/cron/cron.tmp2
-rw-r--r--config/cron/cron.xml8
3 files changed, 14 insertions, 27 deletions
diff --git a/config/cron/cron.inc b/config/cron/cron.inc
index 5636111c..380ecd05 100644
--- a/config/cron/cron.inc
+++ b/config/cron/cron.inc
@@ -48,25 +48,14 @@ function pkg_is_service_running($servicename)
}
}
-function byte_convert( $bytes ) {
-
- if ($bytes<=0)
- return '0 Byte';
-
- $convention=1000; //[1000->10^x|1024->2^x]
- $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
- $e=floor(log($bytes,$convention));
- return round($bytes/pow($convention,$e),2).' '.$s[$e];
-}
-
-
-
function php_sync_package()
{
global $config;
//synch cron tab
configure_cron();
+ $handle = popen("/usr/local/etc/rc.d/cron.sh start", "r");
+ pclose($handle);
}
@@ -96,17 +85,15 @@ function php_install_command()
//write_config();
- //write_rcfile(array(
- // "file" => "cron.sh",
- // "start" => "/usr/local/bin/php /usr/local/pkg/cron.php >> /var/log/cron.log &",
- // "stop" => "rm /tmp/cron.pid"
- // )
- //);
+ write_rcfile(array(
+ "file" => "cron.sh",
+ "start" => "/usr/sbin/cron -s &",
+ "stop" => "kill -9 `cat /var/run/cron.pid`"
+ )
+ );
php_sync_package();
- //$handle = popen("/usr/local/etc/rc.d/cron.sh start", "r");
- //pclose($handle);
-
+
//if (pkg_is_service_running('cron')) {
//documentation purposes
//}
diff --git a/config/cron/cron.tmp b/config/cron/cron.tmp
index 17bb3cc1..110dd8da 100644
--- a/config/cron/cron.tmp
+++ b/config/cron/cron.tmp
@@ -90,7 +90,7 @@ if ($config_change == 1) {
<td><p><!--<span class="vexpl"><span class="red"><strong>Cron<br></strong></span>-->
Cron controls the scheduling of commands.
<br /><br />
- For more information see: <a href='http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html'>http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html</a>
+ For more information see: <a href='http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html' target='_blank'>http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html</a>
</p></td>
</tr>
</table>
diff --git a/config/cron/cron.xml b/config/cron/cron.xml
index 4fbe7ab6..f6338c7c 100644
--- a/config/cron/cron.xml
+++ b/config/cron/cron.xml
@@ -41,7 +41,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>Cron Settings</name>
- <version>0.2</version>
+ <version>0.1.2</version>
<title>Settings</title>
<include_file>/usr/local/pkg/cron.inc</include_file>
<menu>
@@ -52,10 +52,10 @@
<url>/packages/cron/cron.php</url>
</menu>
<service>
- <name>cron</name>
+ <name>Cron</name>
<rcfile>cron.sh</rcfile>
- <executable>cron</executable>
- <description>PHP run from a command line as a service.</description>
+ <executable>/usr/sbin/cron</executable>
+ <description>The cron utility is used to manage commands on a schedule.</description>
</service>
<tabs>
<tab>