Skip to content

Commit 19849b0

Browse files
authored
Add systemd unit parameterization to tt pack docs (#4332)
Resolves #4201
1 parent 0714fe3 commit 19849b0

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

doc/reference/tooling/tt_cli/pack.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,46 @@ The package contains the following files:
3636

3737
You can also pass various :ref:`options <tt-pack-options>` to the ``tt pack`` command to adjust generation properties, for example, customize a bundle name, choose which artifacts should be included, specify the required application dependencies.
3838

39+
.. _tt-pack-systemd:
40+
41+
systemd unit parameters
42+
-----------------------
43+
44+
You can customize your application's systemd unit file generated by ``tt pack``.
45+
To add parameters to the unit file, define them in a YAML file named ``systemd-unit-params.yml``
46+
in the :ref:`application directory <admin-instance_config-develop-app>`.
47+
48+
.. code-block:: console
49+
50+
$ tt pack rpm # unit file with parameters from systemd-unit-params.yml if it exists
51+
52+
You can also pass unit parameters from an arbitrary file by adding the ``--unit-params-file``
53+
option to the ``tt pack`` call:
54+
55+
.. code-block:: console
56+
57+
$ tt pack rpm --unit-params-file my-params.yml # unit file with parameters from my-params.yml
58+
59+
.. important::
60+
61+
The ``systemd-unit-params.yml`` file has a higher priority than the ``--unit-params-file`` option.
62+
If this file exists, it overrides parameters from the file passed in the option.
63+
64+
``tt pack`` supports the following systemd unit parameters:
65+
66+
- ``FdLimit`` -- the number of open file descriptors (``LimitNOFile`` in the unit file).
67+
- ``instance-env`` -- a list of environment variables in the ``<VAR_NAME>: <VALUE>`` format.
68+
Each list item adds an ``Environment=<VAR_NAME>=<VALUE>`` line to the unit file.
69+
70+
An example of the ``systemd-unit-params.yml`` file:
71+
72+
.. code-block:: yaml
73+
74+
FdLimit: 200
75+
instance-env:
76+
INSTANCE: "inst:%i"
77+
TARANTOOL_WORKDIR: "/tmp"
78+
3979
4080
.. _tt-pack-options:
4181

@@ -145,6 +185,10 @@ Options
145185
Specify a Tarantool version for packaging in a Docker container.
146186
For use with ``--use-docker`` only.
147187

188+
.. option:: --unit-params-file
189+
190+
The path to a file with custom :ref:`systemd unit parameters <tt-pack-systemd>`.
191+
148192
.. option:: --use-docker
149193

150194
Build a package in an Ubuntu 18.04 Docker container. To specify a Tarantool
@@ -166,6 +210,10 @@ Options
166210

167211
Include Tarantool and ``tt`` binaries in a bundle.
168212

213+
.. option:: --with-tarantool-deps
214+
215+
Add Tarantool and ``tt`` as package dependencies.
216+
169217
.. option:: --without-binaries
170218

171219
Don't include Tarantool and ``tt`` binaries in a bundle.

0 commit comments

Comments
 (0)