! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
genmon configuration hangs if command has no output or hangs
Status:
RESOLVED: FIXED
Product:
Xfce4-genmon-plugin
Component:
General

Comments

Description Steve 2008-04-23 22:32:53 CEST
Reproduce by adding a new genmon plugin and configuring it to invoke "/bin/true" or "cat /dev/null". After clicking "Close", the configuration window remains displayed and cannot be closed except by killing the genmon process. Preferred behavior would be to close the configuration window and display "XXX" after invoking the command. The same problem occurs if the command hangs (reproduce with "sleep 30").

Strace shows that the genmon process is hung in poll().
$ ps -e | grep genmon
14272 ?        00:00:00 xfce4-genmon-pl
$ strace -p 14272 -f 2>x.log

[pid 14291] execve("/bin/true", ["/bin/true"...], [/* 39 vars */]) = 0
...
[pid 14291] exit_group(0)               = ?
Process 14291 detached
--- SIGCHLD (Child exited) @ 0 (0) ---
waitpid(14291, NULL, 0)                 = 14291
poll( <unfinished ...>
Process 14272 detached
Comment 1 Steve 2008-04-29 04:33:53 CEST
Created attachment 1607 
close unused pipe ends so poll() returns on end-of-file

This patch fixes the test case with "/bin/true".

Unused pipe ends must be closed for poll() to receive an end-of-file.
See "man 7 pipe".
Comment 2 Florian Rivoal editbugs 2011-02-24 15:20:17 CET
Patch applied. Thanks

Bug #4036

Reported by:
Steve
Reported on: 2008-04-23
Last modified on: 2011-02-24

People

Assignee:
Florian Rivoal
CC List:
0 users

Version

Version:
3.2 or older

Attachments

Additional information