Closed astrand closed 8 years ago
I see that the markdown parser is different here. Hopefully the message got across.
Original comment by: kousu
Original comment by: astrand
Closed in favour of http://sourceforge.net/p/xclip/patches/9/
Original comment by: astrand
xclip forks to the background, but it does not daemonize properly (e.g. as explained at http://stackoverflow.com/questions/3095566/linux-daemonize). This bit me while working on https://github.com/kousu/hashapass: if I try to builds script on my script, they hang.
I tracked down the problem to xclip. hang.sh contains a test case showing the problem. When I run it, I see
with it hanging there until ctrl-c. If you
pkill xclip
or select something else to copy, the script continues and finishes.I've played around with this and the culprit is pipe:[302803]: notice that xclip has a write end of it open, because it inherited it from its (now dead) parent which inherited it from the subshell, and the root script has the read end open. Since $(...) blocks until it has all the content, it blocks until all write ends are closed, which never happens because xclip doesn't touch its fds once it forks (or maybe it does, but they aren't going anywhere useful).
I like xclip and use very much--it's in my aliases. I'm happy to be able to contribute to it, if you'll accept my patch.
After the patch, hang.sh no longer hangs:
(by the way, your INSTALL instructions are incomplete: they don't mention "autoconf" which is needed before ./configure exists)
Reported by: kousu
Original Ticket: xclip/patches/8