diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-08 08:27:18 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-08 08:27:18 -0300 |
commit | 889cdef19f38613d8f02cabdd7d4e362b215ad3f (patch) | |
tree | 0f5bd9bbfc8317c1d0294f9b66a495f51bc3bc14 | |
parent | 46556938dc1664a6a9dd75ff99e78e192088c769 (diff) | |
parent | 8e993b1cc9d294a1569ef4078f55bce00dca44c3 (diff) | |
download | pfsense-packages-889cdef19f38613d8f02cabdd7d4e362b215ad3f.tar.gz pfsense-packages-889cdef19f38613d8f02cabdd7d4e362b215ad3f.tar.bz2 pfsense-packages-889cdef19f38613d8f02cabdd7d4e362b215ad3f.zip |
Merge pull request #1040 from doktornotor/patch-12
-rw-r--r-- | config/syslog-ng/syslog-ng.inc | 65 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 |
2 files changed, 7 insertions, 60 deletions
diff --git a/config/syslog-ng/syslog-ng.inc b/config/syslog-ng/syslog-ng.inc index 57a94f96..41fce416 100644 --- a/config/syslog-ng/syslog-ng.inc +++ b/config/syslog-ng/syslog-ng.inc @@ -58,14 +58,17 @@ function syslogng_install_command() { if (!file_exists("/usr/local/lib/syslog-ng")) { @symlink(SYSLOGNG_BASEDIR . "local/lib/syslog-ng", "/usr/local/lib/syslog-ng"); } - syslogng_install_cron(true); + $crontask = "/usr/bin/nice -n20 " . SYSLOGNG_BASEDIR . "local/sbin/logrotate /usr/local/etc/logrotate.conf"; + install_cron_job("${crontask}", true, "0"); syslogng_resync(); } function syslogng_deinstall_command() { - if (is_link("/usr/local/lib/syslog-ng")) + if (is_link("/usr/local/lib/syslog-ng")) { unlink("/usr/local/lib/syslog-ng"); - syslogng_install_cron(false); + } + $crontask = "/usr/bin/nice -n20 " . SYSLOGNG_BASEDIR . "local/sbin/logrotate /usr/local/etc/logrotate.conf"; + install_cron_job("${crontask}", false); unlink_if_exists("/usr/local/etc/logrotate.conf"); unlink_if_exists("/usr/local/etc/syslog-ng.conf"); filter_configure(); @@ -137,62 +140,6 @@ function syslogng_validate_advanced($post, &$input_errors) { } } -function syslogng_install_cron($should_install) { - global $config; - - if (platform_booting()) { - return; - } - - if (!$config['cron']['item']) { - return; - } - - $x=0; - $rotate_job_id=-1; - $rotate_is_installed = false; - - foreach ($config['cron']['item'] as $item) { - if (strstr($item['task_name'], "syslogng_rotate_logs")) { - $rotate_job_id = $x; - } - $x++; - } - $need_write = false; - switch ($should_install) { - case true: - if ($rotate_job_id < 0) { - $cron_item = array(); - $cron_item['task_name'] = "syslogng_rotate_logs"; - $cron_item['minute'] = "0"; - $cron_item['hour'] = "*"; - $cron_item['mday'] = "*"; - $cron_item['month'] = "*"; - $cron_item['wday'] = "*"; - $cron_item['who'] = "root"; - $cron_item['command'] = "/usr/bin/nice -n20 " . SYSLOGNG_BASEDIR . "local/sbin/logrotate /usr/local/etc/logrotate.conf"; - $config['cron']['item'][] = $cron_item; - $need_write = true; - } - if ($need_write) { - parse_config(true); - write_config("Adding syslog-ng Cron Jobs"); - } - break; - case false: - if ($rotate_job_id >= 0) { - unset($config['cron']['item'][$rotate_job_id]); - $need_write = true; - } - if ($need_write) { - parse_config(true); - write_config("Removing syslog-ng Cron Jobs"); - } - break; - } - configure_cron(); -} - function syslogng_build_default_objects($settings) { $default_objects = array(); diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 5c3d51b1..1219b826 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1495,7 +1495,7 @@ <website>http://www.balabit.com/network-security/syslog-ng/</website> <descr>Syslog-ng syslog server. This service is not intended to replace the default pfSense syslog server but rather acts as an independent syslog server.</descr> <category>Services</category> - <version>1.0.9</version> + <version>1.1</version> <status>ALPHA</status> <required_version>2.2</required_version> <depends_on_package_pbi>syslog-ng-3.6.2_3-##ARCH##.pbi</depends_on_package_pbi> |