1nbdkit-probing(1) NBDKIT nbdkit-probing(1)
2
3
4
6 nbdkit-probing - how to probe for nbdkit configuration and plugins
7
9 nbdkit --dump-config
10
11 nbdkit PLUGIN --dump-plugin
12
14 You can query information about nbdkit and available plugins from the
15 nbdkit binary.
16
17 Query basic configuration
18 nbdkit --dump-config
19
20 lists information about how nbdkit was configured. The most important
21 fields in the output are the name of the directory where nbdkit looks
22 for plugins and the version of nbdkit, eg:
23
24 plugindir=/usr/lib64/nbdkit/plugins
25 version=1.2.3
26
27 Query information about a particular plugin
28 nbdkit pluginname --dump-plugin
29
30 (where pluginname is the name or full path of a plugin) will dump
31 information about that plugin, eg:
32
33 $ nbdkit file --dump-plugin
34 path=/usr/lib64/nbdkit/plugins/nbdkit-file-plugin.so
35 name=file
36 version=1.2.3
37 api_version=1
38 struct_size=176
39 thread_model=serialize_requests
40 [etc]
41
42 Plugins which ship with nbdkit usually have the same version as the
43 corresponding nbdkit binary. The nbdkit binary will always be able to
44 utilize plugins compiled against an older version of the header;
45 however, newer plugins may not be fully supported by an older nbdkit
46 binary (for example, a plugin compiled with "NBDKIT_API_VERSION" of 2
47 fails to load with an older nbdkit that only knows "NBDKIT_API_VERSION"
48 1).
49
50 Detect if a plugin is installed
51 To find out if a plugin is installed (and working) in the plugin
52 directory, use --dump-plugin as above:
53
54 $ nbdkit foo --dump-plugin
55 nbdkit: error: cannot open plugin 'foo': /usr/lib64/nbdkit/plugins/nbdkit-foo-plugin.so: cannot open shared object file: No such file or directory
56 Use 'nbdkit --help' or read the nbdkit(1) manual page for documentation.
57
58 Note it is better to test for the existence of plugins this way rather
59 than just seeing if the .so file exists, because nbdkit will load the
60 plugin and check that all its dependencies can be satisfied, and also
61 that plugin registration works.
62
63 List all plugins in the plugin directory
64 You could simply get the plugin directory (from --dump-config) and list
65 all files in this directory called nbdkit-*-plugin.so.
66
67 However a better test is to run --dump-plugin (see above) on each one
68 to check that it is working and all of its dependencies are installed.
69 A complete shell script which does this is:
70
71 #!/bin/sh -
72 plugindir=`nbdkit --dump-config | grep ^plugindir= | sed 's/[^=]*=//'`
73 for f in $plugindir/nbdkit-*-plugin.so; do
74 if nbdkit "$f" --dump-plugin >/dev/null 2>&1; then
75 b=`echo "$f" | sed 's,.*/nbdkit-\(.*\)-plugin.so$,\1,'`
76 echo "$b ($f)"
77 fi
78 done
79
81 nbdkit(1).
82
84 Eric Blake
85
86 Richard W.M. Jones
87
88 Pino Toscano
89
91 Copyright (C) 2013-2018 Red Hat Inc.
92
94 Redistribution and use in source and binary forms, with or without
95 modification, are permitted provided that the following conditions are
96 met:
97
98 · Redistributions of source code must retain the above copyright
99 notice, this list of conditions and the following disclaimer.
100
101 · Redistributions in binary form must reproduce the above copyright
102 notice, this list of conditions and the following disclaimer in the
103 documentation and/or other materials provided with the
104 distribution.
105
106 · Neither the name of Red Hat nor the names of its contributors may
107 be used to endorse or promote products derived from this software
108 without specific prior written permission.
109
110 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
111 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
112 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
113 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
114 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
115 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
116 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
117 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
118 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
119 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
120 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
121
122
123
124nbdkit-1.12.3 2019-05-21 nbdkit-probing(1)