diff --git a/emhttp/plugins/dynamix/nchan/update_1 b/emhttp/plugins/dynamix/nchan/update_1 index 429a33e96..3937a3830 100755 --- a/emhttp/plugins/dynamix/nchan/update_1 +++ b/emhttp/plugins/dynamix/nchan/update_1 @@ -17,16 +17,15 @@ $varroot = '/var/local/emhttp'; require_once "$docroot/webGui/include/publish.php"; while (true) { - unset($memory,$sys,$rpms,$lsof); + unset($memory,$sys,$zfs,$rpms,$lsof); exec("grep -Po '^Mem(Total|Available):\s+\K\d+' /proc/meminfo",$memory); exec("df /boot /var/log /var/lib/docker|grep -Po '\d+%'",$sys); exec("sensors -uA 2>/dev/null|grep -Po 'fan\d_input: \K\d+'",$rpms); + exec("awk '/^c_max|^size/{print \$3}' /proc/spl/kstat/zfs/arcstats 2>/dev/null",$zfs); [$total,$free] = $memory; $used = $total-$free; - $zfs = (exec("awk '/^size/{print \$3;exit}' /proc/spl/kstat/zfs/arcstats 2>/dev/null")?:0)/1024; - $info = max(round(100*(1-$free/$total)),0)."%\0".round(100*$zfs/$used)."%\0".implode("\0",$sys); + $info = max(round(100*(1-$free/$total)),0)."%\0".round(100*($zfs[1]??0)/($zfs[0]??1))."%\0".implode("\0",$sys); $rpms = count($rpms) ? implode(" RPM\0",$rpms).' RPM' : ''; - $names = array_keys((array)parse_ini_file("$varroot/shares.ini")); exec("LANG='en_US.UTF8' lsof -Owl /mnt/disk[0-9]* 2>/dev/null|awk '/^shfs/ && \$0!~/\.AppleD(B|ouble)/ && \$5==\"REG\"'|awk -F/ '{print \$4}'",$lsof); $counts = array_count_values($lsof); $count = []; diff --git a/etc/rc.d/rc.library.source b/etc/rc.d/rc.library.source index f2e5eed8e..6bbb5dc8a 100644 --- a/etc/rc.d/rc.library.source +++ b/etc/rc.d/rc.library.source @@ -157,7 +157,7 @@ check() { fi done <<< $(ip -br -6 addr|awk '/^(br|bond|eth|wg)[0-9]+(\.[0-9]+)?/ && $3 !~ "^fe80" {print $1,$3}') # add loopback interface - if [[ "smb nfs ntp" =~ $CALLER ]]; then + if [[ "smb nfs" =~ $CALLER ]]; then [[ $ipv4 == yes ]] && bind+=(127.0.0.1) [[ $ipv6 == yes ]] && bind+=(::1) fi diff --git a/etc/rc.d/rc.ntpd b/etc/rc.d/rc.ntpd index 02c91cede..71c6d38c8 100755 --- a/etc/rc.d/rc.ntpd +++ b/etc/rc.d/rc.ntpd @@ -21,12 +21,10 @@ build_ntp() { # ignore unused protocol [[ $ipv4 == no ]] && echo "interface ignore ipv4" >>$CONF [[ $ipv6 == no ]] && echo "interface ignore ipv6" >>$CONF - # for now do not bind interfaces - # it is not clear why NTP is started several times and fails to bind on occasion # add listen interfaces - #for net in $bind; do - # echo "interface listen $net" >>$CONF - #done + for net in $bind; do + echo "interface listen $net" >>$CONF + done fi # add configured NTP servers [[ -n $NTP_SERVER1 ]] && echo "server $NTP_SERVER1 iburst" >>$CONF @@ -94,7 +92,7 @@ ntpd_reload() { ntpd_update() { [[ $(pgrep -cf $NTPD) -eq 0 ]] && exit 1 # not running - if check && [[ -z "$(this 'interface listen')" || "$(this 'interface listen')" == "$bind" ]]; then + if check && [[ "$(this 'interface listen')" == "$bind" ]]; then # no action required exit 1 else