Bug 473422 - gpm -D does not write log if stdout is file or pipe
Summary: gpm -D does not write log if stdout is file or pipe
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gpm
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Zdenek Prikryl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-28 13:11 UTC by Denys Vlasenko
Modified: 2009-01-07 09:05 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-01-07 09:05:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Denys Vlasenko 2008-11-28 13:11:44 UTC
gpm -D is a option which makes gpm emit some debug info to stdout. I am using it for many years. In recent version it has been broken.

When stdout is a tty, gpm does print some messages:

# gpm -D -2 -m /dev/not_exist -t bare
*** info [startup.c(95)]: Started gpm successfully. Entered daemon mode.

If I want to process them with some program:

# gpm -D -2 -m /dev/not_exist -t bare | cat

No output.

Same happens if I redirect output to a file:

# gpm -D -2 -m /dev/not_exist -t bare >FILE
# ls -l FILE
-rw-r--r-- 1 root root 0 2008-11-27 14:57 FILE

strace reveals that it seems to be done intentionally. gpm tests the type of stdout:

fstat(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0

and if it is not a tty, it doenst print anything. What is the rationale of such a strange behavior?

Another bug is that gpm closes stdin/out/err and loses all further messages (writes them to closed fds), but I was told it is already fixed in newer version.

Comment 1 Fedora Update System 2009-01-06 09:22:45 UTC
gpm-1.20.5-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gpm-1.20.5-2.fc10

Comment 2 Fedora Update System 2009-01-07 09:05:03 UTC
gpm-1.20.5-2.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.