SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does anyone else experience incorrect user-counts by the 'w' and 'top' applications (among others) ?
The problem is always that the usercount reported is higher than the actual number of login shells present, and then even when logging out of KDE, shutting down X, and logging in on virtual console 6 as root, it incorrectly displays usercount as 2, 3 or even 4 (depending on how long since last reboot).
The problem as existed at least since Slackware 10, is on multiple of my PCs and isn't really important enough to give serious attention - it's more like it's nagging me...
Of course, because while in X, all of these applications are listed as "login shells".
However, when you log out of X, some times the usercount remains at 2, even though there's only one user logged in on the console (and X isn't even running anymore), as per the original post.
Hence one login shell, but two users reported.
One way to provoke this seems to be multiple jumps from runlevel 3 to runlevel 1 and back.
not sure what you are talking about, i am running slackware since ver 8.0 never had this issue, here is my output
15:20:47 up 1 day, 21:25, 3 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - Thu08 7:37m 0.02s 0.02s -bash
root pts/0 boca-rjurkov.ver 08:42 0.00s 0.08s 0.00s w
winfinit pts/1 boca-rjurkov.ver 09:26 5:33m 0.00s 0.00s -bash
pts ttys are remote connections, and tty1 is local terminal connection.
also when you saying that you are switching to runlevel 1 meaning you are doing telinit 1 and then back to 3 ? so yah that will kick everybody out, so it is going to fix it, since 1 is single user more, it will log all of your users out, as well as users in vshells.
when you have all those users logged in make sure that you go though vshells (CTRL+ALT+F#) and make sure all of them are showing login screen and not shell. if you are in visual 1 will show you your current X session and 7 i think actaul visual but rest of them should show login screen, if they are not just type exit there, and it will go back to login screen.
please send your "w" output when you have bunch of those users logged in, so i can see TTY and see if FROM is just - or actual domain
not sure what you are talking about, i am running slackware since ver 8.0 never had this issue, here is my output
15:20:47 up 1 day, 21:25, 3 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - Thu08 7:37m 0.02s 0.02s -bash
root pts/0 boca-rjurkov.ver 08:42 0.00s 0.08s 0.00s w
winfinit pts/1 boca-rjurkov.ver 09:26 5:33m 0.00s 0.00s -bash
pts ttys are remote connections, and tty1 is local terminal connection.
This I know and the input above is clearly logged in and the count is correct. My issue is that the usercount (or terminal count) sometimes is left too high when only one user is logged in
Quote:
Originally Posted by winfinit
also when you saying that you are switching to runlevel 1 meaning you are doing telinit 1 and then back to 3 ? so yah that will kick everybody out, so it is going to fix it, since 1 is single user more, it will log all of your users out, as well as users in vshells.
Ofcourse the users are nuked when I'm doing runlevel 1, which is exactly why I'm curious as to why the usercount sometimes (not always) remains at two or three, even though at runlevel one, I am only logged in as root (and there are no screen processes running, no other userids active etc etc).
Quote:
Originally Posted by winfinit
when you have all those users logged in make sure that you go though vshells (CTRL+ALT+F#) and make sure all of them are showing login screen and not shell. if you are in visual 1 will show you your current X session and 7 i think actaul visual but rest of them should show login screen, if they are not just type exit there, and it will go back to login screen.
Not sure what you mean by "all those users" - my problem is the opposite. Only one user logged in, while w and top etc reports two or three. And like I stated before - this is obviously not in X, where "every" terminal counts as a login shell :-)
Quote:
Originally Posted by winfinit
please send your "w" output when you have bunch of those users logged in, so i can see TTY and see if FROM is just - or actual domain
When it happens again, I'll send you a "w" output with no users logged in besides root, and still a usercount of 2 or 3..
Hope I haven't expressed myself too poorly here, but the quirk is about more users than current logged in being reported, not ghost users or incorrect number of ptys etc..
Good call, but nope - it's all correct - also because 9 out of 10 times it works just fine, but especially when I mess a lot back and forth between "console" (Ctrl-F6) and X (Ctrl-F7), and also change to single-user, runlevel 3 and runlevel 4, the system sometimes gets stuck with an artificially high user count, most often reporting 2 logged in users when only one terminal is in use by one user.
The weirdest part is that this happens every blue moon on 5 different computers...
I'll try to provoke an instance of this and post a screenshot..
I get the same thing here. The following is for my current SSH session to my home box with no other users logged in. The list of users is correct (just me on pts/2) but the user count is 3:
Code:
steve@fender:~$ w
09:41:18 up 149 days, 4:11, 3 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
steve pts/2 203.202.23.xxx 09:41 0.00s 0.01s 0.00s w
If I create a second SSH connection, the list of users shows the 2 sessions, but the count of users is 4. Again, there are no other users logged in. If I'm interpreting the output wrongly, I'd like to know what I'm really seeing...
Code:
steve@fender:~$ w
09:46:08 up 149 days, 4:16, 4 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
steve pts/2 203.202.23.xxx 09:41 0.00s 0.01s 0.00s w
steve pts/3 203.202.23.xxx 09:45 10.00s 0.01s 0.01s -bash
When init(8) finds that a process has exited, it locates its utmp entry by ut_pid, sets ut_type to DEAD_PROCESS, and clears ut_user, ut_host and ut_time with null bytes.
Q: The file /var/run/utmp doesn't decrease number of exited processes?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.