update-rc.d.8 4.4 KB

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