You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

231 lines
5.8 KiB

  1. .\" Hey, Emacs! This is an -*- nroff -*- source file.
  2. .\" Authors: Henrique Holschuh
  3. .TH INVOKE\-RC.D 8 "1 March 2001" "Debian Project" "Debian GNU/Linux"
  4. .SH NAME
  5. invoke\-rc.d \- executes System-V style init script actions
  6. .SH SYNOPSIS
  7. .B invoke\-rc.d
  8. .RI [ --quiet ]
  9. .RI [ --force ]
  10. .RI [ --try-anyway ]
  11. .RI [ --disclose-deny ]
  12. .RI [ --query ]
  13. .RI [ --no-fallback ]
  14. .I name
  15. .I action
  16. .RI [ init\ script\ parameters... ]
  17. .HP
  18. .B invoke\-rc.d
  19. .RI [ --help ]
  20. .HP
  21. .SH DESCRIPTION
  22. .B invoke\-rc.d
  23. is a generic interface to execute System V style init script
  24. .BI /etc/init.d/ name \fR
  25. actions, obeying runlevel constraints as well as any local
  26. policies set by the system administrator.
  27. All access to the init scripts by Debian packages' maintainer
  28. scripts should be done through
  29. .B invoke\-rc.d\fR.
  30. This manpage documents only the usage and behavior of
  31. .BR invoke\-rc.d .
  32. For a discussion of the System V style init script arrangements please
  33. see
  34. .BR init (8).
  35. More information on invoke-rc.d can be found in the section on
  36. runlevels and init.d scripts of the
  37. .IR "Debian Policy Manual" .
  38. .SH INIT SCRIPT ACTIONS
  39. The standard actions are:
  40. .IR start ,
  41. .IR stop ,
  42. .IR force\-stop ,
  43. .IR restart ,
  44. .IR try\-restart ,
  45. .IR reload ,
  46. .IR force\-reload ,
  47. and
  48. .IR status .
  49. Other actions are accepted, but they can cause problems to
  50. .B policy\-rc.d
  51. (see the
  52. .B INIT SCRIPT POLICY
  53. section), so warnings are generated if the policy layer
  54. is active.
  55. Please note that not all init scripts will implement all
  56. the actions listed above, and that the policy layer may
  57. override an action to another action(s), or even deny it.
  58. Any extra parameters will be passed to the init script(s) being
  59. executed.
  60. If an action must be carried out regardless of any local
  61. policies, use the
  62. .IR --force
  63. switch.
  64. .SH OPTIONS
  65. .TP
  66. .I --help
  67. Display usage help.
  68. .TP
  69. .I --quiet
  70. Quiet mode, no error messages are generated.
  71. .TP
  72. .I --force
  73. Tries to run the init script regardless of policy and
  74. init script subsystem errors.
  75. .B Use of this option in Debian maintainer scripts is severely discouraged.
  76. .TP
  77. .I --try-anyway
  78. Tries to run the init script if a non-fatal error is
  79. detected.
  80. .TP
  81. .I --disclose-deny
  82. Return status code 101 instead of status code 0 if
  83. the init script action is denied by the policy layer.
  84. .TP
  85. .I --query
  86. Returns one of the status codes 100-106. Does not
  87. run the init script, and implies
  88. .IR --disclose-deny
  89. and
  90. .IR --no-fallback .
  91. .TP
  92. .I --no-fallback
  93. Ignores any fallback action requests by the policy
  94. layer.
  95. .B Warning:
  96. this is usually a very bad idea for any actions other
  97. than
  98. .RI start .
  99. .SH STATUS CODES
  100. Should an init script be executed,
  101. .B invoke\-rc.d
  102. always returns the status code
  103. returned by the init script. Init scripts should not return status codes in
  104. the 100+ range (which is reserved in Debian and by the LSB). The status codes
  105. returned by invoke\-rc.d proper are:
  106. .TP
  107. 0
  108. .IR Success .
  109. Either the init script was run and returned exit status 0 (note
  110. that a fallback action may have been run instead of the one given in the
  111. command line), or it was not run because of runlevel/local policy constrains
  112. and
  113. .B --disclose-deny
  114. is not in effect.
  115. .TP
  116. 1 - 99
  117. Reserved for init.d script, usually indicates a failure.
  118. .TP
  119. 100
  120. .B Init script ID
  121. .BI ( name )
  122. .BR unknown .
  123. This means the init script was not registered successfully through
  124. .B update\-rc.d
  125. or that the init script does not exist.
  126. .TP
  127. 101
  128. .B Action not allowed\fR.
  129. The requested action will not be performed because of runlevel or local
  130. policy constraints.
  131. .TP
  132. 102
  133. .B Subsystem error\fR.
  134. Init script (or policy layer) subsystem malfunction. Also, forced
  135. init script execution due to
  136. .I --try-anyway
  137. or
  138. .I --force
  139. failed\fR.
  140. .TP
  141. 103
  142. .I Syntax error\fR.
  143. .TP
  144. 104
  145. .I Action allowed\fR.
  146. Init script would be run, but
  147. .B --query
  148. is in effect.
  149. .TP
  150. 105
  151. .I Behavior uncertain\fR.
  152. It cannot be determined if action should be carried out or not, and
  153. .B --query
  154. is in effect.
  155. .TP
  156. 106
  157. .I Fallback action requested\fR.
  158. The policy layer denied the requested action, and
  159. supplied an allowed fallback action to be used instead.
  160. .SH INIT SCRIPT POLICY
  161. .B invoke\-rc.d
  162. introduces the concept of a policy layer which is used to verify if
  163. an init script should be run or not, or if something else should be
  164. done instead. This layer has various uses, the most immediate ones
  165. being avoiding that package upgrades start daemons out-of-runlevel,
  166. and that a package starts or stops daemons while inside a chroot
  167. jail.
  168. The policy layer has the following abilities: deny or approve the
  169. execution of an action; request that another action (called a
  170. .IR fallback )
  171. is to be taken, instead of the action requested in invoke\-rc.d's
  172. command line; or request multiple actions to be tried in order, until
  173. one of them succeeds (a multiple
  174. .IR fallback ).
  175. .B invoke\-rc.d
  176. itself only pays attention to the current runlevel; it will block
  177. any attempts to start a service in a runlevel in which the service is
  178. disabled. Other policies are implemented with the use of the
  179. .B policy\-rc.d
  180. helper, and are only available if
  181. .B /usr/sbin/policy\-rc.d
  182. is installed in the system.
  183. .SH FILES
  184. .TP
  185. .BR /etc/init.d/*
  186. System V init scripts.
  187. .TP
  188. .BR /usr/sbin/policy\-rc.d
  189. Init script policy layer helper (not required).
  190. .TP
  191. .BR /etc/runlevel.conf
  192. file-rc runlevel configuration (if the file-rc package is
  193. being used).
  194. .TP
  195. .BR /etc/rc?.d/*
  196. System V runlevel configuration (if the sysv-rc package is
  197. being used).
  198. .SH NOTES
  199. .B invoke\-rc.d
  200. special cases the
  201. .I status
  202. action, and returns exit status 4 instead of exit status 0 when
  203. it is denied.
  204. .SH BUGS
  205. Please report any bugs using the Debian bug tracking system,
  206. http://bugs.debian.org/, packages sysv\-rc or file\-rc
  207. (depending on which version of invoke\-rc.d you are using).
  208. .SH SEE ALSO
  209. .IR "Debian Policy manual" ,
  210. .br
  211. .BR /etc/init.d/skeleton ,
  212. .br
  213. .BR update\-rc.d (8),
  214. .br
  215. .BR init (8),
  216. .br
  217. .BR /usr/share/doc/init-system-helpers/README.policy-rc.d.gz