Bug 473422 - gpm -D does not write log if stdout is file or pipe
gpm -D does not write log if stdout is file or pipe
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: gpm (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Zdenek Prikryl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-28 08:11 EST by Denys Vlasenko
Modified: 2009-01-07 04:05 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-07 04:05:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Denys Vlasenko 2008-11-28 08:11:44 EST
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 04:22:45 EST
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 04:05:03 EST
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.