summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-03-06 06:31:32 +0000
committerColin Smith <colin@pfsense.org>2005-03-06 06:31:32 +0000
commitb7c502bbc1b0787ac0b3c5e1fe9633eca6c391f4 (patch)
treec157b56540dd0bf0026ffe6782fae8b1bfe49928 /etc
parent13c37b778baa23b1e39f0e1710852002a90cccdb (diff)
downloadpfsense-b7c502bbc1b0787ac0b3c5e1fe9633eca6c391f4.zip
pfsense-b7c502bbc1b0787ac0b3c5e1fe9633eca6c391f4.tar.gz
* Minor style cleanups.
* Add sweep_package_processes() to workaround those packages that do not automatically kill processes (iperf and netio servers, for example).
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc24
1 files changed, 18 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index e3d547e..dc2789d 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -532,10 +532,9 @@ function update_progress_bar($percent) {
}
/*
- * resync_all_package_configs_bootup() Force packages to setup their configuration and rc.d files at bootup.
- * This function also prints output to the terminal indicating progress.
+ * resync_all_package_configs_bootup() Force packages to setup their configuration and rc.d files at bootup.
+ * This function also prints output to the terminal indicating progress.
*/
-
function resync_all_package_configs_bootup($show_message) {
global $config;
log_error("Resyncing configuration for all packages.");
@@ -555,6 +554,21 @@ function resync_all_package_configs_bootup($show_message) {
}
/*
+ * sweep_package_processes() Periodically kill a package's unnecessary processes that may still be running (a server that does not automatically timeout, for example)
+ */
+function sweep_package_processes() {
+ global $config;
+ if(!$config['installedpackages']['package']) return;
+ foreach($config['installedpackages']['package'] as $package) {
+ $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "packagegui");
+ if($pkg_config['swept_processes'] <> "") {
+ mwexec("killall" . $pkg_config['swept_processes']);
+ log_error("Killed " . $package['name'] . "'s unnecessary processes.");
+ }
+ }
+}
+
+/*
* gather_altq_queue_stats(): gather alq queue stats and return an array that
* is queuename|qlength|measured_packets
* NOTE: this commandt takes 5 seconds to run
@@ -580,6 +594,4 @@ function gather_altq_queue_stats($dont_return_root_queues) {
}
return $queue_stats;
}
-
-
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud