Git init
[pkgs/e/elektra.git] / doc / elektra.7
1 .\"     Title: elektra
2 .\"    Author: Avi Alkalay <avi at unix.sh>
3 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
4 .\"      Date: March 2004
5 .\"    Manual: 
6 .\"    Source: Elektra Initiative
7 .\"
8 .TH "ELEKTRA" "7" "March 2004" "Elektra Initiative" ""
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 elektra \- A framework to store configuration atoms hierarchically
15 Library Linkage Architecture.PP
16 The Elektra library (\fIlibelektra\&.so\fR) has 2 layers: public methods and backend access, according to the following architecture (these pictures were taken from the
17 \fIElektra presentation\fR\&[1]):
18 .PP
19 .PP
20 When using local backends such as the filesys backend, all key access happens in the actual process space as bellow:
21 .PP
22 .PP
23 A remote daemon backend is also possible as noted bellow:
24 .PP
25
26 True Facts About Elektra
27 .sp
28 .RS 4
29 \h'-04'\(bu\h'+03'It is much more an agreement then a piece of software\&. Relation is 99% to 1%\&.
30 .RE
31 .sp
32 .RS 4
33 \h'-04'\(bu\h'+03'It is a simple and consistent API to help software developers programatically store and retrieve global and user\-specific configuration parameters\&.
34 .RE
35 .sp
36 .RS 4
37 \h'-04'\(bu\h'+03'All key\-value pairs are stored in clear\-text files, UTF\-8 encoded\&. All old charsets are also supported, with automatic transparent conversion to and from UTF\-8\&.
38 .RE
39 .sp
40 .RS 4
41 \h'-04'\(bu\h'+03'API supports change notifications and multiple backends\&.
42 .RE
43 .sp
44 .RS 4
45 \h'-04'\(bu\h'+03'It provides a unique namespace for all values\&. Anywhere, anytime, any program can preciselly access keys by their names\&. Security restrictions may obviously apply\&.
46 .RE
47 .sp
48 .RS 4
49 \h'-04'\(bu\h'+03'It is designed to be secure and lightweight, to let even early boot\-stage programs like
50 \fB/sbin/init\fR
51 to use it, instead of
52 \fI/etc/inittab\fR
53 file\&.
54 .RE
55 .sp
56 .RS 4
57 \h'-04'\(bu\h'+03'It is designed to be easy to administrate with regular command line tools like
58 \fBcat\fR,
59 \fBvi\fR,
60 \fBcp\fR,
61 \fBls\fR,
62 \fBln\fR\&. Its storage is 100% open\&.
63 .RE
64 .sp
65 .RS 4
66 \h'-04'\(bu\h'+03'It tries to set distribution\-independent naming standards to store things like hardware configuration, networking, user\'s session configuration, system\'s mime\-types, parameters for kernel modules, etc, that are generally stored under
67 \fI/etc\fR\&.
68 .RE
69 .sp
70 .RS 4
71 \h'-04'\(bu\h'+03'It requires existing software to be changed to use its API\&. This will substitute hundreds of configuration\-text\-file parsing code, into clear Elektra\'s API key\-value access methods\&.
72 .RE
73 .sp
74 .RS 4
75 \h'-04'\(bu\h'+03'It is POSIX compliant\&. If it doesn\'t compile and run easily on some POSIX system, it should be easily modified to do so\&.
76 .RE
77 Elektra Is Not
78 .sp
79 .RS 4
80 \h'-04'\(bu\h'+03'Is NOT something that accesses SQL/relational databases\&.
81 .RE
82 .sp
83 .RS 4
84 \h'-04'\(bu\h'+03'Is NOT an OS service that can become unavailable and make system unusable\&. It is just a library to access files according to a namespace\&.
85 .RE
86 .sp
87 .RS 4
88 \h'-04'\(bu\h'+03'Is NOT an alternative to network information systems like LDAP or NIS\&. These are still required for networked environments\&.
89 .RE
90 .sp
91 .RS 4
92 \h'-04'\(bu\h'+03'Is NOT a Webmin\-like or other GUI tool to be used by end users\&.
93 .RE
94 .sp
95 .RS 4
96 \h'-04'\(bu\h'+03'Is NOT an additional software layer to edit/generate existing configuration files\&.
97 .RE
98 .sp
99 .RS 4
100 \h'-04'\(bu\h'+03'Is NOT a "configuration system", because one can\'t be created by simply writing some code\&. A configuration system is an ecosystem, and the Elektra Project tries to help build one\&.
101 .RE
102 .sp
103 .RS 4
104 \h'-04'\(bu\h'+03'It doesn\'t know a thing about the semantics of each data it stores\&.
105 .RE
106 Namespaces and Key Names.PP
107 All keys are organized in a hierarchical tree with 2 Namespaces (subtrees) as showed by the picture:
108 .PP
109 .PP
110 \fBsystem\fR
111 .RS 4
112 Contains all subsystems and global application keys/configuration\&. Equivalent to files under
113 \fI/etc\fR
114 directory\&.
115 .RE
116 .PP
117 \fBuser\fR
118 .RS 4
119 The current user\'s keys\&. Equivalent to the dotfiles in a user\'s
120 \fB$HOME\fR
121 directory\&. These keys are phisically stored under the owner user home directory\&. The many
122 \fIuser:\fR\fIusername\fR
123 in the picture shows the full name of those trees\&. Read about user domains bellow for more\&.
124 .RE
125 User Domains.PP
126 Different from the
127 \fIsystem\fR
128 namespace, the
129 \fIuser\fR
130 namespace is dynamic\&. For example, the key
131 \fIuser/env/PATH\fR
132 may have completely different values for users
133 \fIluciana\fR
134 and
135 \fIvaleria\fR\&. In this example, if
136 \fIvaleria\fR
137 wants to access this key at
138 \fIluciana\fR\'s space, it should refer to
139 \fIuser:luciana/env/PATH\fR\&. Access permissions apply\&.
140 .PP
141 User domains were implemented also to address situations when different user names (\fB$USER\fR) have same UID\&. So a user key is stored in his home directory based on the user name, not the UID\&.
142 Inactive Keys.PP
143 A great thing about text configuration files is that some configuration items can be there as an example, but inactive or commented\&. Elektra provides a very simple way to simulate this behavior: if the key name begins with a dot (\&.), it is considered inactive or commented\&. In real world applications, the Elektra API will ignore these keys by default, but the keys are still accessible if the developer wants to\&.
144 .PP
145 These are some keys that have inactive subtrees:
146 .sp
147 .RS 4
148 \h'-04'\(bu\h'+03'\fIsystem/sw/XFree/InputDevice/\&.Mouse3/Driver\fR: All keys under
149 \fI\&.Mouse3/*\fR
150 subtree won\'t be read by default\&.
151 .RE
152 .sp
153 .RS 4
154 \h'-04'\(bu\h'+03'\fIuser:valeria/env/env2/\&.PATH\fR: The
155 \fB$PATH\fR
156 environment variable
157 \fIwon\'t\fR
158 be set when
159 \fIvaleria\fR
160 login\&.
161 .RE
162 .sp
163 .RS 4
164 \h'-04'\(bu\h'+03'\fIsystem/users/\&.louis/uid\fR: The entire
165 \fI\&.louis/*\fR
166 subtree is inactive\&. This is the same as commenting the user entry from a configuration file\&.
167 .RE
168 .PP
169 See bellow more examples of inactive keys\&.
170 Key Examples.PP
171 Here are some valid key names, and their values:
172 .PP
173 The Elektra keys of the combined
174 \fI/etc/passwd\fR
175 and
176 \fI/etc/shadow\fR
177 entry for user \'nobody\' would look like:
178 .sp
179 .RS 4
180 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/uid\fR: 99
181 .RE
182 .sp
183 .RS 4
184 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/gid\fR: 99
185 .RE
186 .sp
187 .RS 4
188 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/gecos\fR: Nobody
189 .RE
190 .sp
191 .RS 4
192 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/home\fR: /
193 .RE
194 .sp
195 .RS 4
196 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/shell\fR: /sbin/nologin
197 .RE
198 .sp
199 .RS 4
200 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/password\fR: *
201 .RE
202 .sp
203 .RS 4
204 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/passwdChangeBefore\fR: 0
205 .RE
206 .sp
207 .RS 4
208 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/passwdChangeAfter\fR: 99999
209 .RE
210 .sp
211 .RS 4
212 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/passwdWarnBefore\fR: 7
213 .RE
214 .sp
215 .RS 4
216 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/passwdDisableAfter\fR:
217 .RE
218 .sp
219 .RS 4
220 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/passwdDisabledSince\fR:
221 .RE
222 .sp
223 .RS 4
224 \h'-04'\(bu\h'+03'\fIsystem/users/nobody/passwdReserved\fR:
225 .RE
226 .PP
227 The environment variables I want set, when I log in, with their full key name:
228 .sp
229 .RS 4
230 \h'-04'\(bu\h'+03'\fIuser:aviram/env/env1/JAVA_HOME\fR: /usr/lib/jvm/java\-1\&.4\&.1\-ibm\-1\&.4\&.1\&.0/jre
231 .RE
232 .sp
233 .RS 4
234 \h'-04'\(bu\h'+03'\fIuser:aviram/env/env2/PATH\fR: $PATH:~/bin:$JAVA_HOME/bin
235 .RE
236 .sp
237 .RS 4
238 \h'-04'\(bu\h'+03'\fIuser:aviram/env/env2/PS1\fR: \eh:\ew\e$
239 .RE
240 .sp
241 .RS 4
242 \h'-04'\(bu\h'+03'\fIuser:aviram/env/env3/PILOTRATE\fR: 57600
243 .RE
244 .PP
245 The entry in
246 \fI/etc/inittab\fR
247 that is responsible for starting X11 would look:
248 .sp
249 .RS 4
250 \h'-04'\(bu\h'+03'\fIsystem/init/x/runlevels\fR: 5
251 .RE
252 .sp
253 .RS 4
254 \h'-04'\(bu\h'+03'\fIsystem/init/x/action\fR: respawn
255 .RE
256 .sp
257 .RS 4
258 \h'-04'\(bu\h'+03'\fIsystem/init/x/process\fR: /etc/X11/prefdm \-nodaemon
259 .RE
260 .PP
261 The users database files and
262 \fI/etc/inittab\fR
263 were Elektrified to key\-value pairs using the
264 \fBusers\-convert\fR
265 and
266 \fBinittab\-convert\fR
267 scripts included with the distribution\&.
268 .PP
269 An example of an elektrified
270 \fI/etc/X11/xorg\&.conf\fR
271 or
272 \fI/etc/X11/XF86Config\fR:
273 .sp
274 .RS 4
275 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Layouts/Default Layout/Inputs/Keyboard0/CoreKeyboard\fR:
276 .RE
277 .sp
278 .RS 4
279 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Layouts/Default Layout/Inputs/Mouse0/CorePointer\fR:
280 .RE
281 .sp
282 .RS 4
283 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Layouts/Default Layout/Screens/Screen0/Absolute\&.x\fR: 0
284 .RE
285 .sp
286 .RS 4
287 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Layouts/Default Layout/Screens/Screen0/Absolute\&.y\fR: 0
288 .RE
289 .sp
290 .RS 4
291 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Layouts/Default Layout/Screens/Screen0/ScreenNumber\fR: 0
292 .RE
293 .sp
294 .RS 4
295 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Files/FontPath\fR: unix/:7100
296 .RE
297 .sp
298 .RS 4
299 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Files/RgbPath\fR: /usr/X11R6/lib/X11/rgb
300 .RE
301 .sp
302 .RS 4
303 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Devices/Videocard0/BoardName\fR: Intel 740 (generic)
304 .RE
305 .sp
306 .RS 4
307 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Devices/Videocard0/Driver\fR: i740
308 .RE
309 .sp
310 .RS 4
311 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Devices/Videocard0/VendorName\fR: Videocard vendor
312 .RE
313 .sp
314 .RS 4
315 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Keyboard0/Driver\fR: keyboard
316 .RE
317 .sp
318 .RS 4
319 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Keyboard0/Options/XkbLayout\fR: us_intl
320 .RE
321 .sp
322 .RS 4
323 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Keyboard0/Options/XkbModel\fR: pc105
324 .RE
325 .sp
326 .RS 4
327 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Mouse0/Driver\fR: mouse
328 .RE
329 .sp
330 .RS 4
331 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Mouse0/Options/Device\fR: /dev/input/mice
332 .RE
333 .sp
334 .RS 4
335 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Mouse0/Options/Emulate3Buttons\fR: yes
336 .RE
337 .sp
338 .RS 4
339 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Mouse0/Options/Protocol\fR: IMPS/2
340 .RE
341 .sp
342 .RS 4
343 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/InputDevices/Mouse0/Options/ZAxisMapping\fR: 4 5
344 .RE
345 .sp
346 .RS 4
347 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/DisplaySize\&.height\fR: 230
348 .RE
349 .sp
350 .RS 4
351 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/DisplaySize\&.width\fR: 300
352 .RE
353 .sp
354 .RS 4
355 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/HorizSync\fR: 30\&.0 \- 61\&.0
356 .RE
357 .sp
358 .RS 4
359 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/ModelName\fR: SyncMaster
360 .RE
361 .sp
362 .RS 4
363 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/Options/dpms\fR:
364 .RE
365 .sp
366 .RS 4
367 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/VendorName\fR: Monitor Vendor
368 .RE
369 .sp
370 .RS 4
371 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/Monitor0/VertRefresh\fR: 56\&.0 \- 75\&.0
372 .RE
373 .sp
374 .RS 4
375 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/\&.Monitor1/HorizSync\fR: 30\&.0 \- 61\&.0
376 .RE
377 .sp
378 .RS 4
379 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/\&.Monitor1/ModelName\fR: Impression
380 .RE
381 .sp
382 .RS 4
383 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/\&.Monitor1/Options/dpms\fR:
384 .RE
385 .sp
386 .RS 4
387 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/\&.Monitor1/VendorName\fR: Monitor Vendor
388 .RE
389 .sp
390 .RS 4
391 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Monitors/\&.Monitor1/VertRefresh\fR: 56\&.0 \- 75\&.0
392 .RE
393 .sp
394 .RS 4
395 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/DefaultDepth\fR: 16
396 .RE
397 .sp
398 .RS 4
399 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/Device\fR: Videocard0
400 .RE
401 .sp
402 .RS 4
403 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/Displays/00/Depth\fR: 16
404 .RE
405 .sp
406 .RS 4
407 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/Displays/00/Modes\fR: 1024x768,800x600,640x480
408 .RE
409 .sp
410 .RS 4
411 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/Displays/00/Viewport\&.x\fR: 0
412 .RE
413 .sp
414 .RS 4
415 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/Displays/00/Viewport\&.y\fR: 0
416 .RE
417 .sp
418 .RS 4
419 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Screens/Screen0/Monitor\fR: Monitor0
420 .RE
421 .sp
422 .RS 4
423 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/dbe\fR:
424 .RE
425 .sp
426 .RS 4
427 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/dri\fR:
428 .RE
429 .sp
430 .RS 4
431 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/extmod\fR:
432 .RE
433 .sp
434 .RS 4
435 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/fbdevhw\fR:
436 .RE
437 .sp
438 .RS 4
439 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/freetype\fR:
440 .RE
441 .sp
442 .RS 4
443 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/glx\fR:
444 .RE
445 .sp
446 .RS 4
447 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/record\fR:
448 .RE
449 .sp
450 .RS 4
451 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/Modules/type1\fR:
452 .RE
453 .sp
454 .RS 4
455 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/DRI/Group\fR: 0
456 .RE
457 .sp
458 .RS 4
459 \h'-04'\(bu\h'+03'\fIsystem/sw/xorg/current/DRI/Mode\fR: 0666
460 .RE
461 .PP
462 Pay attention that the keys bellow
463 \fIsystem/sw/XFree/current/Monitor/\&.Monitor1\fR
464 are inactive because we have
465 \fI\&.Monitor1\fR
466 as their parent\&. So unless special options are used when calling the API, these keys will not be retrieved from the database\&.
467 .PP
468 Throughout this text you will see other examples of key names\&.
469 Key Data Types.PP
470 There are only two types of data that can be stored:
471 .PP
472 \fBText\fR
473 .RS 4
474 Handled as pure text\&. Regardeless of the charset being used, these values are always stored as UTF\-8\&. This ensures very strong internationalization and migration capabilities, while keeping simplicity\&. If you don\'t want the Elektra framework to convert your non\-ASCII text to UTF\-8 (not recomended), you should use the Binary data format\&.
475 .RE
476 .PP
477 \fBBinary\fR
478 .RS 4
479 A stream of bytes, not necessarily text\&. It is recommended that you avoid using binary values because UNIX system administrators tend to consider them as unmanageable blackboxes\&. Anyway, the value will be encoded into pure text format based on hexadecimal digits, for openness and ease of administration\&. This data type should also be avoided because it is less efficient\&.
480 .RE
481 .PP
482 There are very good reasons why types like
483 \fBInteger\fR,
484 \fBTime\fR,
485 \fBFont\fR,
486 \fBList\fR, etc were not implemented: Elektra was designed to be usefull for any type of program, so having more specific data types implicates in the definition of value limits, separators in the storage format, etc, that may be good for some application and bad for other\&. So the semantics of the data is handled by the application\&. A program or framework may define its own special data handling methods using these essential basic types\&. See the
487 \fBkeyGetType()\fR
488 and
489 \fBkeySetType()\fR
490 methods documentation in the
491 \fBkdb\fR(3)
492 man page to understand how to set keys with your own data types\&.
493 .PP
494 There are more two types of keys:
495 .PP
496 \fBDirectory\fR
497 .RS 4
498 It can\'t store a value, but, as a directory in a filesystem, it serves as a way to group correlated keys\&.
499 .RE
500 .PP
501 \fBLink\fR
502 .RS 4
503 It is a link to another key\&. They work as symbolic links in the filesystem: when trying to access them, you will actually access the key they point to\&. The API also provides ways to access these special keys without dereferencing them\&.
504 .RE
505 Key Meta Data.PP
506 Besides the key name and the value, each key has other attributes:
507 .PP
508 \fBOwner\'s User and Group\fR
509 .RS 4
510 This is a system\'s UID and GID equal to the ones found in regular files\' attributes\&.
511 .RE
512 .PP
513 \fBAccess Permissions\fR
514 .RS 4
515 Filesystem\-like access permissions for user, group and others\&.
516 .RE
517 .PP
518 \fBModification, Access and Stat Times\fR
519 .RS 4
520 Last time a key was modified, readed and stated (listed), respectively\&.
521 .RE
522 .PP
523 \fBKey Comment\fR
524 .RS 4
525 Pretty much as a configuration file comment\&. Not intended to be used in GUI applications, because it isn\'t internationalizable\&.
526 .RE
527 Fine Grained Security Example.PP
528 To show this metadata in action, this screen shows the
529 \fBkdb\fR
530 command listing keys and their attributes related to user
531 \fInobody\fR\&.
532 .sp
533 .RS 4
534 .nf
535 bash$ \fBkdb ls \-Rlv system/users/nobody\fR
536 \-rw\-r\-\-r\-\-   root  root    17 Mar 31 09:07 system/users/nobody/uid=99
537 \-rw\-r\-\-r\-\-   root  root    17 Mar 31 09:07 system/users/nobody/gid=99
538 \-rw\-r\-\-r\-\-   root  root    21 Mar 31 09:07 system/users/nobody/gecos=Nobody
539 \-rw\-r\-\-r\-\-   root  root    16 Mar 31 09:07 system/users/nobody/home=/
540 \-rw\-r\-\-r\-\-   root  root    28 Mar 31 09:07 system/users/nobody/shell=/sbin/nologin
541 \-rw\-\-\-\-\-\-\-   root  root    16 Mar 31 09:07 system/users/nobody/password
542 \-rw\-\-\-\-\-\-\-   root  root    16 Mar 31 09:07 system/users/nobody/passwdChangeBefore
543 \-rw\-\-\-\-\-\-\-   root  root    20 Mar 31 09:07 system/users/nobody/passwdChangeAfter
544 \-rw\-\-\-\-\-\-\-   root  root    16 Mar 31 09:07 system/users/nobody/passwdWarnBefore
545 \-rw\-\-\-\-\-\-\-   root  root    15 Mar 31 09:07 system/users/nobody/passwdDisableAfter
546 \-rw\-\-\-\-\-\-\-   root  root    15 Mar 31 09:07 system/users/nobody/passwdDisabledSince
547 \-rw\-\-\-\-\-\-\-   root  root    15 Mar 31 09:07 system/users/nobody/passwdReserved
548                         
549 .fi
550 .RE
551 .PP
552 We ran the
553 \fBkdb\fR
554 command without super\-user credentials, asking for long (\fB\-l\fR), recursive (\fB\-R\fR) listing, and to show each key value (\fB\-v\fR)\&. But (since we are) regular user, we don\'t have permission to see the values of the
555 \fIsystem/users/nobody/passwd*\fR
556 fields\&.
557 .PP
558 The users database files were elektrified to key\-value pairs using the
559 \fBusers\-convert\fR
560 script included with the distribution\&.
561 ExamplesSetting Keys.PP
562 bash$\fBkdb set \-c "My first key" user/example/key "Some nice value"\fR
563 .PP
564 bash$\fBkdb set user:luciana/example/key \-\- "Some \- nice \- value with dashes"\fR
565 .PP
566 bash#\fBKDB_ROOT=user:http/sw/httpd kdb set \-u nobody \-g http key "Some value"\fR
567 .PP
568 bash$\fBkdb set \-b image\&.png \-t bin user/example/binaryKey\fR
569 .PP
570 bash$\fBkdb set \-b file\&.txt user/example/regularKey\fR
571 .PP
572 bash#\fBkdb set \-t link system/sw/XFree/current system/sw/XFree/handmade\fR
573 Getting Keys.PP
574 bash$\fBKDB_ROOT=user/example kdb get some/key/name\fR
575 .PP
576 bash$\fBeval `kdb get \-s user/env/env1/PS1`\fR
577 .PP
578 bash$\fBKDB_BACKEND=gconf kdb get user/sw/gnome\-terminal/global/active_encodings\fR
579 Listing.PP
580 bash$\fBkdb ls \-laR user:valeria\fR
581 .PP
582 bash$\fBkdb ls \-lR system/sw/xorg/current\fR
583 .PP
584 bash$\fBKDB_ROOT=system/sw kdb ls \-lR xorg\fR
585 .PP
586 bash$\fBKDB_BACKEND=fstab kdb ls \-Rv system/filesystems\fR
587 .PP
588 bash$\fBeval `kdb ls \-Rvs user/env/env2`\fR
589 Miscelaneous.PP
590 bash#\fBkdb ln system/sw/xorg/handmade system/sw/xorg/current\fR
591 .PP
592 bash#\fBkdb mv system/sw/xorg/current system/sw/xorg/old\fR
593 .PP
594 bash#\fBkdb rm system/inittab/rc4\fR
595 .PP
596 bash$\fBKDB_BACKEND=gconf kdb rm user/gconfKey\fR
597 XML Import and Export.PP
598 bash#\fBkdb export user/sw/app | sed \-e \'s|/app/|/app2/|g\' | kdb import\fR
599 .PP
600 bash#\fBKDB_ROOT=system/sw kdb export myapp > myappconf\&.xml\fR
601 .PP
602 bash#\fBkdb import myappconf\&.xml\fR
603 .PP
604 bash$\fBKDB_BACKEND=gconf kdb export user/sw\fR
605 .SH "SEE ALSO"
606 .PP
607 \fBkdb\fR(1),
608 \fBelektra\fR(5)
609 .SH "AUTHOR"
610 .PP
611 \fBAvi Alkalay\fR <\&avi at unix\&.sh\&>
612 .br
613 Linux Market Developer, Senior IT and Software Architect, IBM Linux Impact Team :: \fIibm\&.com/linux\fR
614 .sp -1n
615 .IP "" 4
616 Author.
617 .SH "COPYRIGHT"
618 Copyright \(co 2004 Avi Alkalay
619 .br
620 .SH "NOTES"
621 .IP " 1." 4
622 Elektra presentation
623 .RS 4
624 \%elektra.sxi
625 .RE