Project

General

Profile

« Previous | Next » 

Revision 3c44c845

Added by Luiz Souza over 7 years ago

Silence warnings generated by sysctl to standard error.

View differences:

build/scripts/build_freebsd.sh
95 95
[ ! -f ${srcdir}/sys/sys/param.h ] \
96 96
	&& err "Source directory is missing sys/sys/param.h"
97 97

  
98
ncpu=$(sysctl -n hw.ncpu)
98
ncpu=$(sysctl -qn hw.ncpu)
99 99
njobs=$((ncpu*2))
100 100
j="-j${njobs}"
101 101

  
build/scripts/install_freebsd.sh
126 126
[ ! -f ${srcdir}/sys/sys/param.h ] \
127 127
	&& err "Source directory is missing sys/sys/param.h"
128 128

  
129
ncpu=$(sysctl -n hw.ncpu)
129
ncpu=$(sysctl -qn hw.ncpu)
130 130
njobs=$((ncpu*2))
131 131
j="-j${njobs}"
132 132

  
src/etc/inc/interfaces.inc
2823 2823
	}
2824 2824
	$ifconfig = "/sbin/ifconfig";
2825 2825
	$sysctl = "/sbin/sysctl";
2826
	$sysctl_args = "-q";
2826 2827
	$killall = "/usr/bin/killall";
2827 2828

  
2828 2829
	/* Set all wireless ifconfig variables (split up to get rid of needed checking) */
......
3068 3069
	if (!empty($wl_sysctl)) {
3069 3070
		fwrite($fd_set, "# sysctls for {$baseif}\n");
3070 3071
		foreach ($wl_sysctl as $wl_sysctl_line) {
3071
			fwrite($fd_set, "{$sysctl} {$wl_sysctl_prefix}.{$wl_sysctl_line}\n");
3072
			fwrite($fd_set, "{$sysctl} ${sysctl_args} {$wl_sysctl_prefix}.{$wl_sysctl_line}\n");
3072 3073
		}
3073 3074
	}
3074 3075

  
src/etc/inc/rrd.inc
634 634
		}
635 635

  
636 636
		/* the Memory stats gathering function. */
637
		$rrdupdatesh .= "MEM=`$sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_cache_count vm.stats.vm.v_wire_count | ";
637
		$rrdupdatesh .= "MEM=`$sysctl -qn vm.stats.vm.v_page_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_cache_count vm.stats.vm.v_wire_count | ";
638 638
		$rrdupdatesh .= " $awk '{getline active;getline inactive;getline free;getline cache;getline wire;printf ";
639 639
		$rrdupdatesh .= "((active/$0) * 100)\":\"((inactive/$0) * 100)\":\"((free/$0) * 100)\":\"((cache/$0) * 100)\":\"(wire/$0 * 100)}'`\n";
640 640
		$rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$mem N:\${MEM}\n";
src/etc/inc/system.inc
59 59

  
60 60
function get_sysctl_descr($sysctl) {
61 61
	unset($output);
62
	$_gb = exec("/sbin/sysctl -nd {$sysctl}", $output);
62
	$_gb = exec("/sbin/sysctl -qnd {$sysctl}", $output);
63 63

  
64 64
	return $output[0];
65 65
}
src/etc/inc/util.inc
2031 2031
		$name_list = array(escapeshellarg($names));
2032 2032
	}
2033 2033

  
2034
	exec("/sbin/sysctl -i " . implode(" ", $name_list), $output);
2034
	exec("/sbin/sysctl -iq " . implode(" ", $name_list), $output);
2035 2035
	$values = array();
2036 2036
	foreach ($output as $line) {
2037 2037
		$line = explode(": ", $line, 2);
......
2076 2076
		$value_list[] = escapeshellarg($key) . "=" . escapeshellarg($value);
2077 2077
	}
2078 2078

  
2079
	exec("/sbin/sysctl -i " . implode(" ", $value_list), $output, $success);
2079
	exec("/sbin/sysctl -iq " . implode(" ", $value_list), $output, $success);
2080 2080

  
2081 2081
	/* Retry individually if failed (one or more read-only) */
2082 2082
	if ($success <> 0 && count($value_list) > 1) {
2083 2083
		foreach ($value_list as $value) {
2084
			exec("/sbin/sysctl -i " . $value, $output);
2084
			exec("/sbin/sysctl -iq " . $value, $output);
2085 2085
		}
2086 2086
	}
2087 2087

  
src/etc/rc.php_ini_setup
33 33
fi
34 34

  
35 35
if [ -z "$AVAILMEM" ]; then
36
	MEM=`/sbin/sysctl hw.physmem | cut -d':' -f2`
36
	MEM=`/sbin/sysctl -q hw.physmem | cut -d':' -f2`
37 37
	AVAILMEM=`/bin/expr $MEM / 1048576`
38 38
fi
39 39

  
40 40

  
41 41
# Get amount of ram installed on this system
42
REALMEM=`/sbin/sysctl hw.realmem | /usr/bin/awk '{print $2/1048576}' | /usr/bin/awk -F '.' '{print $1}'`
42
REALMEM=`/sbin/sysctl -q hw.realmem | /usr/bin/awk '{print $2/1048576}' | /usr/bin/awk -F '.' '{print $1}'`
43 43
export REALMEM
44 44
export LOWMEM
45 45

  
src/usr/local/bin/beep.sh
35 35
fi
36 36

  
37 37
# Check for different HZ
38
HZ=`/sbin/sysctl -n kern.hz`
38
HZ=`/sbin/sysctl -qn kern.hz`
39 39
if [ "$HZ" = "1" ]; then
40 40
	NOTELENGTH="10"
41 41
fi
src/usr/local/www/status.php
336 336
defCmdT("OS-Message Buffer (Boot)", "/bin/cat /var/log/dmesg.boot");
337 337

  
338 338
/* OS/Hardware Status */
339
defCmdT("OS-sysctl values", "/sbin/sysctl -a");
339
defCmdT("OS-sysctl values", "/sbin/sysctl -aq");
340 340
defCmdT("OS-Kernel Environment", "/bin/kenv");
341 341
defCmdT("OS-Installed Packages", "/usr/sbin/pkg info");
342 342
defCmdT("Hardware-PCI Devices", "/usr/sbin/pciconf -lvb");
src/usr/local/www/widgets/include/thermal_sensors.inc
30 30
//NOTE: depends on proper config in System >> Advanced >> Miscellaneous tab >> Thermal Sensors section.
31 31
function getThermalSensorsData() {
32 32

  
33
	$_gb = exec("/sbin/sysctl -a | grep temperature", $dfout);
33
	$_gb = exec("/sbin/sysctl -aq | grep temperature", $dfout);
34 34
	$dfout_filtered = array_filter($dfout, function($v) {
35 35
		return strpos($negsign, ' -') === false;
36 36
	});
src/usr/local/www/widgets/widgets/thermal_sensors.widget.php
26 26
//called by showThermalSensorsData() (jQuery Ajax call) in thermal_sensors.js
27 27
if (isset($_REQUEST["getThermalSensorsData"])) {
28 28

  
29
	$_gb = exec("/sbin/sysctl -a | grep temperature", $dfout);
29
	$_gb = exec("/sbin/sysctl -aq | grep temperature", $dfout);
30 30
	$dfout_filtered = array_filter($dfout, function($v) {
31 31
		return strpos($negsign, ' -') === false;
32 32
	});

Also available in: Unified diff