diff options
author | mcrane <mctch@yahoo.com> | 2009-04-06 16:49:16 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-04-06 16:49:16 -0600 |
commit | 7dd374f607fd71775bae43d0ac17c4e97495b8aa (patch) | |
tree | 65e628ac4db9b90cac662631541233f3a7d740e1 | |
parent | 34791a81ef20f06aeb93fc84243c346da984bbd6 (diff) | |
download | pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.tar.gz pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.tar.bz2 pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.zip |
Cron package monitor process
-rw-r--r-- | config/cron/cron.inc | 31 | ||||
-rw-r--r-- | config/cron/cron.tmp | 2 | ||||
-rw-r--r-- | config/cron/cron.xml | 8 | ||||
-rwxr-xr-x | pkg_config.7.xml | 2 |
4 files changed, 15 insertions, 28 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> diff --git a/pkg_config.7.xml b/pkg_config.7.xml index 1054ccf3..d24f9af0 100755 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -162,7 +162,7 @@ <pkginfolink></pkginfolink> <config_file>http://www.pfsense.com/packages/config/cron/cron.xml</config_file> <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url> - <version>0.1.1</version> + <version>0.1.2</version> <status>Beta</status> <required_version>1.2</required_version> <maintainer>markjcrane@gmail.com</maintainer> |