Date: Sat, 06 May 2017 23:47:10 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 219113] [feature request][patch] Make ruptime(1) more specific about number of users Message-ID: <bug-219113-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219113 Bug ID: 219113 Summary: [feature request][patch] Make ruptime(1) more specific about number of users Product: Base System Version: 11.0-STABLE Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: andyf@andyit.com.au Keywords: patch I had to think twice and read the man page for ruptime(1) when it reported 0 users on machines I knew I was logged in to multiple times (see -a flag). I propose the following simple patch: --- /usr/src/usr.bin/ruptime/ruptime.c 2017-05-07 09:24:38.767786000 +1000 +++ ./ruptime.c 2016-12-11 09:39:26.693397000 +1000 @@ -242,11 +242,12 @@ continue; } (void)printf( - "%-25.25s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", + "%-25.25s%s, %4d %suser%s load %*.2f, %*.2f, %*.2f\n", wd->wd_hostname, interval((time_t)wd->wd_sendtime - (time_t)wd->wd_boottime, " up"), hsp->hs_nusers, + aflg ? "" : "active ", hsp->hs_nusers =3D=3D 1 ? ", " : "s,", maxloadav >=3D 1000 ? 5 : 4, wd->wd_loadav[0] / 100.0, which produces an output like this: andyf@deepthink:~ % ruptime deepthink up 36+16:20, 1 active user, load 0.20, 0.28, 0.44 drunkfish up 55+14:37, 3 active users, load 0.60, 0.26, 0.20 hummer up 42+23:15, 1 active user, load 0.11, 0.08, 0.05 snuggles up 131+15:26, 8 active users, load 0.20, 0.21, 0.17 andyf@deepthink:~ % ruptime -a deepthink up 36+16:20, 3 users, load 0.20, 0.28, 0.= 44 drunkfish up 55+14:37, 8 users, load 0.60, 0.26, 0.= 20 hummer up 42+23:15, 2 users, load 0.11, 0.08, 0.= 05 snuggles up 131+15:26, 13 users, load 0.20, 0.21, 0.= 17 andyf@deepthink:~ %=20 (note: I've deleted 8 spaces from the first column to stop line-wrap) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219113-8>