mythbuntu-bugs team mailing list archive
-
mythbuntu-bugs team
-
Mailing list archive
-
Message #05879
[Bug 875817] Re: who -q no longer counts gui users
This re-clasification is a problem since the "checklogin.sh" script is
not actually a part of mythtv. It is a user written script that exists
and is maintained only on the mythtv wiki.
Let me give a bit of history of what was attempted to make this work:
The first attempt used 'last | grep "still logged in"' This failed once
a month since it relied on a log file that was erased once a month. The
first time the computer was turned on at the beginning of the month, the
user would login, the log file would get erased, and there was no longer
any record of the user being logged in, so mythtv would shut the
computer down on them as they were using it.
The second attempt was the command 'w | grep " 0 users"' This failed
when a user would use the ctl-alt-Fx command and log in on a different
text screen. The problem here is that even though the user would log
out, the users count would never decrement. This would leave the
computer running forever even after the user logged out since the user
count would never go to zero.
The third attempt was the command 'who -q | grep "users=0"'. This worked
until the update to 10.10.
I just looked at the ck-list-sessions command. This does not give me a
count of the number of users logged in. This command is undocumented,
there is no man page or info page. A google search for 'ck-list-
sessions' finds plenty of bug reports against it, but as far as I could
tell, no documentation. Since it is not clear what this command is
reporting, or what it will report when no one is logged in, I'm not
clear on how I can use it.
Looking at the man page for utmp, it is clear that who -q will be
unreliable for the purpose of determining how many are logged in since
it appears both gnome and unity ignore the utmp file.
So I am left with no clear way of determining if anyone is currently
logged into the computer. I'd like a solution that would survive OS
upgrades so I don't have to keep patching this script.
--
You received this bug notification because you are a member of Mythbuntu
Bug Team, which is subscribed to mythtv in Ubuntu.
https://bugs.launchpad.net/bugs/875817
Title:
who -q no longer counts gui users
Status in “mythtv” package in Ubuntu:
New
Bug description:
The "checklogin.sh" script on this page: http://www.mythtv.org/wiki/ACPI_Wakeup uses "who -q" to determine if a user is logged in to prevent MythTV from shutting down the computer when a user is using the computer.
On 11.04 this worked fine.
On 11.10, my system shuts down 10 minutes after booting unless I open a terminal window.
On opening a terminal window and running "who -q" I get:
$ who -q
dpeale
# users=1
I used to get "users=2". The gui user is not counted anymore.
This is true of both Unity and Gnome GUIs
The 'w' command also has the same bug (I've never been able to figure
out what package that comes from). It also has another bug. If you use
one of the ctl-alt-Fx screens, login, and then logout, it continues to
count that screen as logged in.
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: coreutils 8.5-1ubuntu6
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Sun Oct 16 09:24:27 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: coreutils
UpgradeStatus: Upgraded to oneiric on 2011-10-15 (0 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/875817/+subscriptions