diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-03-09 11:37:35 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-03-09 11:37:35 +0000 |
commit | b12933e28ac504f461dc1a2f9d4682c72f538d0e (patch) | |
tree | ef149e6eaa23d27a14f81f049da80e232223a2c1 | |
parent | 039a077e5531bc53703caf6474ed23573eae4d2b (diff) | |
download | virt-what-b12933e28ac504f461dc1a2f9d4682c72f538d0e.tar.gz virt-what-b12933e28ac504f461dc1a2f9d4682c72f538d0e.tar.xz virt-what-b12933e28ac504f461dc1a2f9d4682c72f538d0e.zip |
docs: Document that SIGPIPE should not be masked when running virt-what.
-rw-r--r-- | virt-what.pod | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/virt-what.pod b/virt-what.pod index 156406e..99547c0 100644 --- a/virt-what.pod +++ b/virt-what.pod @@ -179,6 +179,24 @@ whether C<virt-what> managed detection "correctly" (which is basically unknowable given the large variety of virtualization systems out there and that some systems deliberately emulate others). +=head1 RUNNING VIRT-WHAT FROM OTHER PROGRAMS + +C<virt-what> is designed so that you can easily run it from +other programs or wrap it up in a library. + +Your program should check the exit status (see the section above). + +Some programming languages (notably Python: issue 1652) erroneously +mask the C<SIGPIPE> signal and do not restore it when executing +subprocesses. C<virt-what> is a shell script and some shell commands +do not work correctly when you do this. You may see warnings from +C<virt-what> similar to this: + + echo: write error: Broken pipe + +The solution is to set the C<SIGPIPE> signal handler back to C<SIG_DFL> +before running C<virt-what>. + =head1 IMPORTANT NOTE Most of the time, using this program is the I<wrong> thing to do. |