| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
.. groonga-command |
| 4 |
.. database: commands_table_shutdown |
| 5 |
|
| 6 |
``shutdown`` |
| 7 |
============ |
| 8 |
|
| 9 |
Summary |
| 10 |
------- |
| 11 |
|
| 12 |
``shutdown`` stops the Groonga server process. |
| 13 |
|
| 14 |
``shutdown`` uses graceful shutdown by default. If there are some |
| 15 |
running commands, the Groonga server process stops after these running |
| 16 |
commands are finished. New command requests aren't processed after |
| 17 |
``shutdown`` command is executed. |
| 18 |
|
| 19 |
.. versionadded:: 6.0.1 |
| 20 |
|
| 21 |
``shutdown`` uses immediate shutdown by specifying ``immediate`` to |
| 22 |
``mode`` parameter. The Groonga server process stops immediately |
| 23 |
even when there are some running commands. |
| 24 |
|
| 25 |
.. note:: |
| 26 |
|
| 27 |
You need to set :doc:`/reference/command/request_id` to all |
| 28 |
requests to use immediate shutdown. |
| 29 |
|
| 30 |
.. versionadded:: 9.1.2 |
| 31 |
|
| 32 |
The Groonga HTTP server accepts immediate shutdown immediately even when all threads are used. |
| 33 |
|
| 34 |
.. note:: |
| 35 |
|
| 36 |
This feature can only use on the Groonga HTTP server. |
| 37 |
|
| 38 |
Syntax |
| 39 |
------ |
| 40 |
|
| 41 |
This command takes only one optional parameter:: |
| 42 |
|
| 43 |
shutdown [mode=graceful] |
| 44 |
|
| 45 |
Usage |
| 46 |
----- |
| 47 |
|
| 48 |
``shutdown`` use graceful shutdown by default: |
| 49 |
|
| 50 |
.. groonga-command |
| 51 |
.. include:: ../../example/reference/commands/shutdown/default.log |
| 52 |
.. shutdown |
| 53 |
|
| 54 |
You can specify ``graceful`` to ``mode`` parameter explicitly: |
| 55 |
|
| 56 |
.. groonga-command |
| 57 |
.. database: commands_table_shutdown |
| 58 |
.. include:: ../../example/reference/commands/shutdown/graceful.log |
| 59 |
.. shutdown --mode graceful |
| 60 |
|
| 61 |
You can choose immediate shutdown by specifying ``immediate`` to |
| 62 |
``mode`` parameter: |
| 63 |
|
| 64 |
.. groonga-command |
| 65 |
.. database: commands_table_shutdown |
| 66 |
.. include:: ../../example/reference/commands/shutdown/immediate.log |
| 67 |
.. shutdown --mode immediate |
| 68 |
|
| 69 |
Immediate shutdown is useful when you don't have time for graceful |
| 70 |
shutdown. For example, Windows kills service that takes long time to |
| 71 |
stop on Windows shutdown. |
| 72 |
|
| 73 |
Parameters |
| 74 |
---------- |
| 75 |
|
| 76 |
This section describes parameters of this command. |
| 77 |
|
| 78 |
Required parameters |
| 79 |
^^^^^^^^^^^^^^^^^^^ |
| 80 |
|
| 81 |
There is no required parameter. |
| 82 |
|
| 83 |
Optional parameters |
| 84 |
^^^^^^^^^^^^^^^^^^^ |
| 85 |
|
| 86 |
There are optional parameters. |
| 87 |
|
| 88 |
``mode`` |
| 89 |
"""""""" |
| 90 |
|
| 91 |
Specifies shutdown mode. Here are available shutdown modes: |
| 92 |
|
| 93 |
.. list-table:: |
| 94 |
:header-rows: 1 |
| 95 |
|
| 96 |
* - Value |
| 97 |
- Description |
| 98 |
* - ``graceful`` |
| 99 |
- Stops after running commands are finished. |
| 100 |
|
| 101 |
This is the default. |
| 102 |
* - ``immediate`` |
| 103 |
- .. versionadded:: 6.0.1 |
| 104 |
|
| 105 |
Stops immediately even if there are some running commands. |
| 106 |
|
| 107 |
Return value |
| 108 |
------------ |
| 109 |
|
| 110 |
``shutdown`` returns ``true`` as body when shutdown is |
| 111 |
accepted:: |
| 112 |
|
| 113 |
[HEADER, true] |
| 114 |
|
| 115 |
If ``shutdown`` doesn't accept shutdown, error details are in |
| 116 |
``HEADER``. |
| 117 |
|
| 118 |
See :doc:`/reference/command/output_format` for ``HEADER``. |