update-rc.d.8 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. .\" Hey, Emacs! This is an -*- nroff -*- source file.
  2. .\" Authors: Ian Jackson
  3. .TH UPDATE\-RC.D 8 "23rd August 1996" "Debian Project" "Debian/GNU Linux"
  4. .SH NAME
  5. update\-rc.d \- install and remove System-V style init script links
  6. .SH SYNOPSIS
  7. .B update\-rc.d
  8. .IB name " remove"
  9. .HP
  10. .B update-rc.d
  11. .IB name " defaults"
  12. .RI [ NN " | " NN-start " " NN-stop ]
  13. .HP
  14. .B update-rc.d
  15. .I name
  16. .BR start | stop
  17. .IR "NN runlevel runlevel " ...
  18. .B .
  19. .BR start | stop
  20. .IR "NN runlevel runlevel " ...
  21. .BR . " ..."
  22. .SH DESCRIPTION
  23. .B update-rc.d
  24. automatically updates the System V style init script links
  25. .BI /etc/rc runlevel .d/ NNname
  26. to scripts
  27. .BI /etc/init.d/ name \fR.
  28. These are run by
  29. .B init
  30. when changing runlevels and are generally used to start and stop
  31. system services such as daemons.
  32. .I runlevel
  33. is one of the runlevels supported by
  34. .BR init ", " 0123456 ,
  35. and
  36. .I NN
  37. is the two-digit sequence code used by
  38. .B init
  39. to decide which order to run the scripts in.
  40. This manpage documents only the usage and behaviour of
  41. .BR update-rc.d .
  42. For a discussion of the System V style init script arrangements please
  43. see
  44. .BR init (8)
  45. and the
  46. .IR "dpkg programmers' manual" .
  47. .SH INSTALLING INIT SCRIPT LINKS
  48. When run with either the
  49. .BR defaults ", " start ", or " stop
  50. options, update-rc.d makes links
  51. .BI /etc/rc runlevel .d/[SK] NNname
  52. pointing to the script
  53. .BI /etc/init.d/ name\fR,
  54. If any links
  55. .BI /etc/rc runlevel .d/?? name
  56. already exist then
  57. .B update-rc.d
  58. does nothing. This is so that the system administrator can rearrange
  59. the links, provided that they leave at least one link remaining,
  60. without having their configuration overwritten.
  61. If
  62. .B defaults
  63. is used then
  64. .B update-rc.d
  65. will make links to start the service in runlevels
  66. .B 2345
  67. and stop the service in runlevels
  68. .BR 016 .
  69. By default all the links will have sequence code, but
  70. this can be overridden by supplying one or two
  71. .I NN
  72. arguments; one argument overrides the sequence code for both start and
  73. stop links whereas of two arguments the first overrides the code for
  74. start links and the second that for stop links.
  75. Instead of
  76. .B defaults
  77. the runlevels in which to start and stop the service may be specified
  78. explicitly using a series of sets of arguments:
  79. Each of these sets starts with an argument
  80. .BR start " or " stop
  81. to specify whether start or stop links are to be created by that set.
  82. Then follows
  83. .IR NN ,
  84. the sequence code number for all the links in the set, and one or more
  85. runlevel numbers as a single argument each. The set is terminated by
  86. an argument
  87. .B .
  88. (a single full stop).
  89. When explicit specification, rather than
  90. .BR defaults ,
  91. is used there will usually be one
  92. .B start
  93. and one
  94. .B stop
  95. set. If different sequence codes are required in different runlevels
  96. then several
  97. .B start
  98. sets or several
  99. .B stop
  100. sets may be specified.
  101. The script
  102. .BI /etc/init.d/ name
  103. must exist before
  104. .B update-rc.d
  105. is run to create the links.
  106. .SH REMOVING SCRIPTS
  107. When invoked with the
  108. .I remove
  109. option, update-rc.d removes any links in the
  110. .BI /etc/rc runlevel .d
  111. directories to the script
  112. .BI /etc/init.d/ name\fR.
  113. The script must have been deleted already -
  114. .B update-rc.d
  115. checks for this.
  116. .B update-rc.d
  117. is usually called from a package's post-removal script when that
  118. script detects that its first argument is
  119. .BR purge ,
  120. indicating that the user has requested the configuration for the
  121. package to be removed.
  122. .SH BUGS
  123. This script is written in
  124. .B sh
  125. and is therefore far too slow.
  126. There should be a way for the system administrator to specify at least
  127. the default start and stop runlevels to be used by
  128. .B defaults
  129. and possibly to override other things as well.
  130. .SH FILES
  131. .TP
  132. .B /etc/init.d/
  133. The directory containing the actual init scripts.
  134. .TP
  135. .B /etc/rc?.d/
  136. The directories containing the links used by
  137. .TP
  138. .B /etc/init.d/skeleton
  139. Model for use by writers of
  140. .B init.d
  141. scripts.
  142. .BR init
  143. and managed by
  144. .BR update-rc.d .
  145. .SH SEE ALSO
  146. .IR "dpkg programmers manual" ,
  147. .br
  148. .BR /etc/init.d/skeleton ,
  149. .br
  150. .BR init (8).