PageRenderTime 46ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/chkconfig-1.3.59/alternatives.8

#
Unknown | 413 lines | 411 code | 2 blank | 0 comment | 0 complexity | b804ed2147fd06395989a28998aaaab5 MD5 | raw file
Possible License(s): GPL-2.0
  1. .\" alternatives.8
  2. .\" This man page is copyright 1997 Charles Briscoe-Smith, 2002 Red Hat, Inc.
  3. .\" This is free documentation; you can redistribute it and/or modify
  4. .\" it under the terms of the GNU General Public License as published
  5. .\" by the Free Software Foundation; either version 2 of the License, or
  6. .\" (at your option) any later version.
  7. .TH UPDATE-ALTERNATIVES 8 "27 January 2001"
  8. .SH NAME
  9. alternatives \- maintain symbolic links determining default commands
  10. .SH SYNOPSIS
  11. .B alternatives
  12. .RI [ options ]
  13. .B --install
  14. .I link name path priority
  15. .RB [ --slave
  16. .I link name
  17. .IR path ]...
  18. .RB [ --initscript
  19. .IR service ]
  20. .PP
  21. .B alternatives
  22. .RI [ options ]
  23. .B --remove
  24. .I name path
  25. .PP
  26. .B alternatives
  27. .RI [ options ]
  28. .B --set
  29. .I name path
  30. .PP
  31. .B alternatives
  32. .RI [ options ]
  33. .B --auto
  34. .I name
  35. .PP
  36. .B alternatives
  37. .RI [ options ]
  38. .B --display
  39. .I name
  40. .PP
  41. .B alternatives
  42. .RI [ options ]
  43. .B --config
  44. .I name
  45. .SH DESCRIPTION
  46. .B alternatives
  47. creates, removes, maintains and displays information about the symbolic
  48. links comprising the alternatives system. The alternatives system is
  49. a reimplementation of the Debian alternatives system. It was rewritten
  50. primarily to remove the dependence on perl; it is intended to be a drop
  51. in replacement for Debian's \fBupdate-dependencies\fR script. This man
  52. page is a slightly modified version of the man page from the Debian project.
  53. .PP
  54. It is possible for several programs fulfilling the same or similar
  55. functions to be installed on a single system at the same time.
  56. For example, many systems have several text editors installed at once.
  57. This gives choice to the users of a system, allowing each to use a
  58. different editor, if desired, but makes it difficult for a program
  59. to make a good choice of editor to invoke if the
  60. user has not specified a particular preference.
  61. .PP
  62. The alternatives system aims to solve this problem.
  63. A generic name in the filesystem is
  64. shared by all files providing interchangeable functionality.
  65. The alternatives system and the system administrator
  66. together determine which actual file is referenced by this generic name.
  67. For example, if the text editors
  68. .BR ed (1)
  69. and
  70. .BR nvi (1)
  71. are both installed on the system, the alternatives system will cause
  72. the generic name
  73. .I /usr/bin/editor
  74. to refer to
  75. .I /usr/bin/nvi
  76. by default. The system administrator can override this and cause
  77. it
  78. to refer to
  79. .I /usr/bin/ed
  80. instead,
  81. and the alternatives system will not alter this setting until explicitly
  82. requested to do so.
  83. .PP
  84. The generic name is not a direct symbolic link to the selected alternative.
  85. Instead, it is a symbolic link to a name in the
  86. .I alternatives
  87. .IR directory ,
  88. which in turn is a symbolic link to the actual file referenced.
  89. This is done so that the system administrator's changes can be confined
  90. within the
  91. .I /etc
  92. directory: the FHS (q.v.) gives reasons why this is a Good Thing.
  93. .PP
  94. When each package
  95. providing a file with a particular functionality is
  96. installed, changed or removed,
  97. .B alternatives
  98. is called to update information about that file in the alternatives system.
  99. .B alternatives
  100. is usually called from the
  101. .B %post
  102. or
  103. .B %pre
  104. scripts in RPM packages.
  105. .PP
  106. It is often useful for a number of alternatives to be synchronised,
  107. so that they are changed as a group; for example, when several versions
  108. of the
  109. .BR vi (1)
  110. editor are installed, the man page referenced by
  111. .I /usr/share/man/man1/vi.1
  112. should correspond to the executable referenced by
  113. .IR /usr/bin/vi .
  114. .B alternatives
  115. handles this by means of
  116. .I master
  117. and
  118. .I slave
  119. links; when the master is changed, any associated slaves are changed
  120. too.
  121. A master link and its associated slaves make up a
  122. .I link
  123. .IR group .
  124. .PP
  125. Each link group is, at any given time,
  126. in one of two modes: automatic or manual.
  127. When a group is in automatic mode, the alternatives system will
  128. automatically decide, as packages are installed and removed,
  129. whether and how to update the links.
  130. In manual mode, the alternatives system will not change the links;
  131. it will leave all the decisions to the system administrator.
  132. .PP
  133. Link groups are in automatic mode when they are first introduced to
  134. the system.
  135. If the system administrator makes changes to the system's
  136. automatic settings,
  137. this will be noticed the next time
  138. .B alternatives
  139. is run on the changed link's group,
  140. and the group will automatically be switched to manual mode.
  141. .PP
  142. Each alternative has a
  143. .I priority
  144. associated with it.
  145. When a link group is in automatic mode,
  146. the alternatives pointed to by members of the group
  147. will be those which have the highest priority.
  148. .PP
  149. When using the
  150. .I --config
  151. option,
  152. .B alternatives
  153. will list all of the choices for the link group
  154. of which given
  155. .I name
  156. is the master link.
  157. You will then be prompted for which of the choices to use
  158. for the link group. Once you make a change, the link group will no
  159. longer be in
  160. .I auto
  161. mode. You will need to use the
  162. .I --auto
  163. option in order to return to the automatic state.
  164. .SH TERMINOLOGY
  165. Since the activities of
  166. .B alternatives
  167. are quite involved, some specific terms will help to explain its
  168. operation.
  169. .TP
  170. generic name
  171. A name, like
  172. .IR /usr/bin/editor ,
  173. which refers, via the alternatives system, to one of a number of
  174. files of similar function.
  175. .TP
  176. symlink
  177. Without any further qualification, this means a symbolic link in the
  178. alternatives directory: one which the system administrator is expected
  179. to adjust.
  180. .TP
  181. alternative
  182. The name of a specific file in the filesystem, which may be made
  183. accessible via a generic name using the alternatives system.
  184. .TP
  185. alternatives directory
  186. A directory, by default
  187. .IR /etc/alternatives ,
  188. containing the symlinks.
  189. .TP
  190. administrative directory
  191. A directory, by default
  192. .IR /var/lib/alternatives ,
  193. containing
  194. .BR alternatives '
  195. state information.
  196. .TP
  197. link group
  198. A set of related symlinks, intended to be updated as a group.
  199. .TP
  200. master link
  201. The link in a link group which determines how the other links in the
  202. group are configured.
  203. .TP
  204. slave link
  205. A link in a link group which is controlled by the setting of
  206. the master link.
  207. .TP
  208. automatic mode
  209. When a link group is in automatic mode,
  210. the alternatives system ensures that the links in the group
  211. point to the highest priority alternatives
  212. appropriate for the group.
  213. .TP
  214. manual mode
  215. When a link group is in manual mode,
  216. the alternatives system will not make any changes
  217. to the system administrator's settings.
  218. .SH OPTIONS
  219. Exactly one action must be specified if
  220. .B alternatives
  221. is to perform any meaningful task.
  222. Any number of the common options may be specified together with any action.
  223. .SS "COMMON OPTIONS"
  224. .TP
  225. .B --verbose
  226. Generate more comments about what
  227. .B alternatives
  228. is doing.
  229. .TP
  230. .B --quiet
  231. Don't generate any comments unless errors occur.
  232. This option is not yet implemented.
  233. .TP
  234. .B --test
  235. Don't actually do anything, just say what would be done.
  236. This option is not yet implemented.
  237. .TP
  238. .B --help
  239. Give some usage information (and say which version of
  240. .B alternatives
  241. this is).
  242. .TP
  243. .B --version
  244. Tell which version of
  245. .B alternatives
  246. this is (and give some usage information).
  247. .TP
  248. \fB--altdir\fR \fIdirectory\fR
  249. Specifies the alternatives directory, when this is to be
  250. different from the default.
  251. .TP
  252. \fB--admindir\fR \fIdirectory\fR
  253. Specifies the administrative directory, when this is to be
  254. different from the default.
  255. .SS ACTIONS
  256. .\" The names of the arguments should be identical with the ones
  257. .\" in SYNOPSIS section.
  258. .TP
  259. \fB--install\fR \fIlink name path priority\fR [\fB--slave\fR \fIslink sname spath\fR] [\fB--initscript\fR \fIservice\fR]...
  260. Add a group of alternatives to the system.
  261. .I name
  262. is the generic name for the master link,
  263. .I link
  264. is the name of its symlink,
  265. .I path
  266. is the alternative being introduced for the master link, and
  267. .I priority
  268. is the priority of the alternatives group. Higher priorities
  269. take precendence if no alternative is manually selected.
  270. .IR sname ,
  271. .I slink
  272. and
  273. .I spath
  274. are the generic name, symlink name and alternative
  275. for a slave link, and
  276. .I service
  277. is the name of any associated initscript for the alternative.
  278. .B NOTE:
  279. .B --initscript
  280. is a Red Hat Linux specific option.
  281. Zero or more
  282. .B --slave
  283. options, each followed by three arguments,
  284. may be specified.
  285. .IP
  286. If the master symlink specified exists already
  287. in the alternatives system's records,
  288. the information supplied will be added as a new
  289. set of alternatives for the group.
  290. Otherwise, a new group, set to automatic mode,
  291. will be added with this information.
  292. If the group is in automatic mode,
  293. and the newly added alternatives' priority is higher than
  294. any other installed alternatives for this group,
  295. the symlinks will be updated to point to the newly added alternatives.
  296. If
  297. .B --initscript
  298. is used, the alternatives system will manage the initscript
  299. associated with the alternative via
  300. .B chkconfig,
  301. registering and unregistering the init script depending on
  302. which alternative is active.
  303. .B NOTE:
  304. .B --initscript
  305. is a Red Hat Linux specific option.
  306. .TP
  307. \fB--remove\fR \fIname path\fR
  308. Remove an alternative and all of its associated slave links.
  309. .I name
  310. is a name in the alternatives directory, and
  311. .I path
  312. is an absolute filename to which
  313. .I name
  314. could be linked. If
  315. .I name
  316. is indeed linked to
  317. .IR path ,
  318. .I name
  319. will be updated to point to another appropriate alternative, or
  320. removed if there is no such alternative left.
  321. Associated slave links will be updated or removed, correspondingly.
  322. If the link is not currently pointing to
  323. .IR path ,
  324. no links are changed;
  325. only the information about the alternative is removed.
  326. .TP
  327. \fB--set\fR \fIname path\fR
  328. The symbolic link and slaves for link group \fIname\fR set to those
  329. configured for \fIpath\fR, and the link group is set to manual mode.
  330. This option is not in the original Debian implementation.
  331. .TP
  332. \fB--config\fR \fIname\fR
  333. Present the user with a configuration menu for choosing
  334. the master link and slaves for link group \fIname\fR. Once
  335. chosen, the link group is set to manual mode.
  336. .TP
  337. \fB--auto\fR \fIname\fR
  338. Switch the master symlink
  339. .I name
  340. to automatic mode.
  341. In the process, this symlink and its slaves are updated
  342. to point to the highest priority installed alternatives.
  343. .TP
  344. \fB--display\fR \fIname\fR
  345. Display information about the link group of which
  346. .I name
  347. is the master link.
  348. Information displayed includes the group's mode
  349. (auto or manual),
  350. which alternative the symlink currently points to,
  351. what other alternatives are available
  352. (and their corresponding slave alternatives),
  353. and the highest priority alternative currently installed.
  354. .SH FILES
  355. .TP
  356. .I /etc/alternatives/
  357. The default alternatives directory.
  358. Can be overridden by the
  359. .B --altdir
  360. option.
  361. .TP
  362. .I /var/lib/alternatives/
  363. The default administration directory.
  364. Can be overridden by the
  365. .B --admindir
  366. option.
  367. .SH "EXIT STATUS"
  368. .IP 0
  369. The requested action was successfully performed.
  370. .IP 2
  371. Problems were encountered whilst parsing the command line
  372. or performing the action.
  373. .SH DIAGNOSTICS
  374. .B alternatives
  375. chatters incessantly about its activities on its standard output channel.
  376. If problems occur,
  377. .B alternatives
  378. outputs error messages on its standard error channel and
  379. returns an exit status of 2.
  380. These diagnostics should be self-explanatory;
  381. if you do not find them so, please report this as a bug.
  382. .SH BUGS
  383. If you find a bug, please report it using the Red Hat bug tracking system
  384. at \fBhttp://bugzilla.redhat.com\fR.
  385. .PP
  386. If you find any discrepancy between the operation of
  387. .B alternatives
  388. and this manual page, it is a bug,
  389. either in the implementation or the documentation; please report it.
  390. Any significant differences between this implementation and Debian's is
  391. also a bug and should be reported, unless otherwise noted in this man page.
  392. .SH AUTHOR
  393. alternatives is copyright 2002
  394. Red Hat, Inc.. It is free software; see the GNU General Public Licence
  395. version 2 or later for copying conditions. There is NO warranty.
  396. .PP
  397. This manual page is copyright 1997/98 Charles Briscoe-Smith and
  398. 2002 Red Hat, Inc.
  399. This is free documentation; see the GNU General Public Licence
  400. version 2 or later for copying conditions. There is NO WARRANTY.
  401. .SH "SEE ALSO"
  402. .BR ln (1),
  403. FHS, the Filesystem Hierarchy Standard.
  404. alternatives.c
  405. chkconfig.c
  406. COPYING
  407. leveldb.c
  408. leveldb.h
  409. Makefile
  410. ntsysv.c
  411. ook