tazpanel rev 548

index.cgi: add process start time (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 11 21:00:29 2015 +0100 (2015-11-11)
parents e480cc8cc7eb
children 9f014dbbbcf8
files index.cgi
line diff
     1.1 --- a/index.cgi	Wed Nov 11 19:20:07 2015 +0100
     1.2 +++ b/index.cgi	Wed Nov 11 21:00:29 2015 +0100
     1.3 @@ -469,6 +469,11 @@
     1.4  		if [ "$(GET pid)" ] && [ -d /proc/$(GET pid)/ ]; then
     1.5  			curpid=$(GET pid)
     1.6  			curnice=$(awk '{ print $19 }' /proc/$curpid/stat)
     1.7 +			hz=$(zcat /proc/config.gz | sed '/^CONFIG_HZ=/!d;s/.*=//')
     1.8 +			bootttime=$(awk -vhz=${hz:-100} '{print int($22/100)}' /proc/$curpid/stat)
     1.9 +			uptime=$(awk -vhz=$hz '{print int($1)}' /proc/uptime)
    1.10 +			now=$(date +%s)
    1.11 +			starttime=$(date -d @$(($now - ($uptime - $bootttime))))
    1.12  			cat <<EOT
    1.13  <section>
    1.14  	<header>
    1.15 @@ -479,8 +484,8 @@
    1.16  		</form>
    1.17  	</header>
    1.18  <form>
    1.19 -	<p>$(_ 'Start time')
    1.20 -		$(stat -c %y /proc/$curpid)
    1.21 +	<p>$(_ 'Start time:')
    1.22 +		$starttime
    1.23  	</p>
    1.24  	<p>$(_ 'Renice')[$curnice]
    1.25  	<input type="hidden" name="top"/>