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 /config/cron/cron.inc | |
parent | 34791a81ef20f06aeb93fc84243c346da984bbd6 (diff) | |
download | pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.tar.gz pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.tar.bz2 pfsense-packages-7dd374f607fd71775bae43d0ac17c4e97495b8aa.zip |
Cron package monitor process
Diffstat (limited to 'config/cron/cron.inc')
-rw-r--r-- | config/cron/cron.inc | 31 |
1 files changed, 9 insertions, 22 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 //} |