shutdown.8.m4 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. changequote(`@@@',`$$$')dnl
  2. @@@.TH SHUTDOWN "8" "$$$MONTH YEAR@@@" "Dinit $$$VERSION@@@" "Dinit \- service management system"
  3. .SH NAME
  4. $$$SHUTDOWN_PREFIX@@@shutdown, $$$SHUTDOWN_PREFIX@@@halt, $$$SHUTDOWN_PREFIX@@@poweroff, $$$SHUTDOWN_PREFIX@@@reboot, $$$SHUTDOWN_PREFIX@@@soft-reboot \- system shutdown
  5. .\"
  6. .SH SYNOPSIS
  7. .\"
  8. .B $$$SHUTDOWN_PREFIX@@@shutdown
  9. [\fB\-r\fR|\fB\-h\fR|\fB\-p\fR] [\fB\-\-use\-passed\-cfd\fR]
  10. [\fB\-\-system\fR]
  11. .br
  12. \fB$$$SHUTDOWN_PREFIX@@@halt\fR [\fIoptions...\fR]
  13. .br
  14. \fB$$$SHUTDOWN_PREFIX@@@poweroff\fR [\fIoptions...\fR]
  15. .br
  16. \fB$$$SHUTDOWN_PREFIX@@@reboot\fR [\fIoptions...\fR]
  17. .br
  18. \fB$$$SHUTDOWN_PREFIX@@@soft\-reboot\fR [\fIoptions...\fR]
  19. .\"
  20. .SH DESCRIPTION
  21. .\"
  22. This manual page is for the shutdown utility included with the \fBDinit\fR
  23. service manager package. See \fBdinit\fR(8).
  24. .LP
  25. The \fB$$$SHUTDOWN_PREFIX@@@shutdown\fR, \fB$$$SHUTDOWN_PREFIX@@@reboot\fR,
  26. \fB$$$SHUTDOWN_PREFIX@@@soft-reboot\fR, \fB$$$SHUTDOWN_PREFIX@@@poweroff\fR and \fB$$$SHUTDOWN_PREFIX@@@halt\fR
  27. commands can be used to instruct the service manager daemon to perform a service rollback and then to shutdown the system.
  28. They can also perform shutdown directly, without service rollback.
  29. .LP
  30. Note that for consistency with other packages "$$$SHUTDOWN_PREFIX@@@halt" and "$$$SHUTDOWN_PREFIX@@@poweroff" aliases
  31. are provided, however they have no special significance. The default action
  32. is to power down the system if called as either "$$$SHUTDOWN_PREFIX@@@shutdown", "$$$SHUTDOWN_PREFIX@@@halt", or
  33. "$$$SHUTDOWN_PREFIX@@@poweroff".
  34. .\"
  35. .SH OPTIONS
  36. .TP
  37. \fB\-\-help\fR
  38. Display brief help text and then exit.
  39. .TP
  40. \fB\-r\fP
  41. Request a shutdown followed by restart. This is the default if executed as
  42. \fB$$$SHUTDOWN_PREFIX@@@reboot\fR.
  43. .TP
  44. \fB\-s\fP
  45. Restart the service manager and all user-space services without restarting the system.
  46. This is the default if executed as \fB$$$SHUTDOWN_PREFIX@@@soft\-reboot\fR.
  47. .IP
  48. The current boot-time options will be passed on to the restarted dinit and remain in effect
  49. (note that system recovery options, for example, may re-initiate the recovery process).
  50. Services must be suitably configured in order for this option to be useful; using this
  51. option in environments where it is not specifically supported is not recommended.
  52. .TP
  53. \fB\-h\fP
  54. Shutdown and then halt the system (without powering down).
  55. .TP
  56. \fB\-p\fP
  57. Shutdown and then power down the system. This is the default unless executed
  58. as \fB$$$SHUTDOWN_PREFIX@@@reboot\fR or \fB$$$SHUTDOWN_PREFIX@@@soft\-reboot\fR.
  59. .TP
  60. \fB\-\-use\-passed\-cfd\fR
  61. Instead of attempting to open a socket connection to the service daemon,
  62. use a pre-opened connection that has been passed to the process from its parent
  63. via an open file descriptor.
  64. The file descriptor with the connection is identified by the contents of the DINIT_CS_FD
  65. environment variable.
  66. .TP
  67. \fB\-\-system\fR
  68. Shut down directly, instead of by issuing a command to the service manager.
  69. Use of this option should be avoided, but it may allow performing a clean shutdown in case
  70. the service manager has stopped responding.
  71. .IP
  72. The service manager may invoke \fB$$$SHUTDOWN_PREFIX@@@shutdown\fR with this option in order to perform
  73. system shutdown after it has rolled back services.
  74. .\"
  75. .SH SHUTDOWN HOOKS
  76. .\"
  77. To allow for special shutdown actions, if an executable file exists at any of the following
  78. locations, it will be executed before the system is shut down but after terminating all other
  79. processes:
  80. .\"
  81. .RS
  82. .IP \(bu
  83. /etc/dinit/shutdown-hook
  84. .IP \(bu
  85. /lib/dinit/shutdown-hook
  86. .RE
  87. .LP
  88. Only the first existing executable file from the above list will be executed. The first location
  89. is intended to allow customisation by the system administrator (and should usually be a script
  90. which on completion executes the 2nd shutdown hook, if present).
  91. The 2nd location is intended for distribution control.
  92. .LP
  93. If found and successfully executed, the shutdown hook should perform any special shutdown actions
  94. that depend on all processes being terminated.
  95. If the shutdown hook cleanly unmounts (or remounts as read-only) all file systems including the
  96. root file system, it should exit with status 0 (success), which will prevent \fB$$$SHUTDOWN_PREFIX@@@shutdown\fR from
  97. attempting to unmount file systems itself.
  98. If it does not unmount file systems, the script should not exit with status 0.
  99. .\"
  100. .SH SEE ALSO
  101. .\"
  102. \fBdinit\fR(8), \fBdinitctl\fR(8)
  103. .\"
  104. .SH AUTHOR
  105. Dinit, and this manual, were written by Davin McCall.
  106. $$$dnl