[Pkg-acpi-devel] Bug#612849: kbd: fgconsole prints '1' for machine with no video (only serial)

Michael Schutte michi at debian.org
Mon Feb 14 17:18:35 UTC 2011

reassign 612849 acpi-support
retitle 612849 power-funcs: getXuser fails on unused VTs

Hi again, Daniel,

On Fri, Feb 11, 2011 at 01:55:54AM -0500, Daniel Kahn Gillmor wrote:
> acpi-support uses fgconsole to determine where the active console is.
> /usr/share/acpi-support/power-funcs expects it to return "serial" if the 
> serial console is in use.
> I'm currently using a kvm instance that has no graphics card (emulated 
> or otherwise), only serial.  
> however, fgconsole returns "1" instead of "serial" on this system,
> which makes it so that sending an acpi signal (system_powerdown into
> the kvm monitor) has no effect other than printing the following
> message to syslog:
> Feb 11 01:42:45 dirk polkitd[1029]: started daemon version 0.99 using authority implementation `local' version `0.99'
> Feb 11 01:43:44 dirk powerbtn-acpi-support.sh: power-funcs: 'ps wt tty1 --no-headers' failure

I have now investigated this issue in a QEMU instance.  The kernel keeps
track of the active terminal even if no video card is present, and
returns this information when asked for it.  Apart from that, the VTs
and the serial console could be in use simultaneously.  I’m inclined to
conclude that there is no reliable way for fgconsole to accurately
report “serial” – I could certainly come up with an ugly hack, but kbd
already has enough of those.

Considering that your problem is reproducible in another way, namely by
pressing the power button on an unused (e.g., getty-less) console, I’d
say the bug is actually in /usr/share/acpi-support/power-funcs.

acpi-support maintainers: The above error is logged because of ps (in
getXconsole) exiting with status 1 if it cannot find any processes
matching the query.  Given the explicit test for non-emptyness in the
next line, it seems as though this were the intended behaviour.  Do you
see any harm in dropping the errors to make some untypical power button
presses work?

Michael Schutte                   | michi@{uiae.at,debian.org}
Innsbruck, Austria                | happily accepting encrypted mail
OpenPGP: 0x16fb 517b a866 c3f6 8f11 1485 f3e4 122f 1D8C 261A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20110214/360b7452/attachment.pgp>

More information about the Pkg-acpi-devel mailing list