update-rc.d.8 4.4 KB

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