Перейти к содержанию

tt service

Integrate with the service manager of the system

Usage

tt service
tt service [flags] <command> [command flags]

Commands

tt service systemd

Make the systemd units that run the instances of an application installed in the system scope.

The template unit <APP>@.service runs one instance, tt instance start --foreground <APP>:%i, with TT_SYSTEM_ROOT set to the root of the system scope, as the user and the group --run-as names, tarantool by default. tt does not restart the instance: systemd does, as Restart= says. The drop-in <APP>@<INSTANCE>.service.d/tt.conf of every instance sets Restart= from the restart field of its record and TimeoutStopSec= from its stop_timeout, with a margin for tt, which stops the instance itself. ExecStart= runs <root>/bin/tt, or the tt that makes the units when the system scope has none.

install records the instances in <root>/etc/<APP>/systemd.yaml: tt instance start, stop, restart and kill refuse them and point at systemctl. tt does not run systemctl itself.

<APP> names an application as the instance commands name it, and the units are made for the system scope only: the user scope and projects are refused; inside a project of the same name, --scope system picks the installed application.

Usage

tt service systemd
tt service systemd [flags] <command> [command flags]

Commands

tt service systemd generate

Print the systemd units of the application: the template unit and the drop-in of every instance, each after a line ==> <file> <==. With --unit-dir the units are written into the directory instead, which is created if need be. Nothing is installed and nothing is recorded: tt instance commands do not leave the instances to the units.

Usage

tt service systemd generate <APP> [flags]

Flags

  • --run-as user[:group] - the user and the group the units run the instances as; the group is the user's name when left out (default tarantool:tarantool)
  • --scope string - scope the application is looked for in: only system is supported
  • --unit-dir string - write the units into this directory instead of printing them

tt service systemd install

Write the systemd units of the application into the unit directory, /etc/systemd/system unless --unit-dir names another, and record in <root>/etc/<APP>/systemd.yaml that the units manage its instances. Run it again after the instances of the application change: it rewrites the units and removes the drop-ins of the instances that are gone. A unit file of the same name that tt did not write is an error, and so is an instance that runs without a unit: stop it with tt instance stop first.

--run-as is recorded with the units: without it, an install over installed units keeps the user and the group they run as.

systemctl is not run: the command prints what to run.

Usage

tt service systemd install <APP> [flags]

Flags

  • --run-as user[:group] - the user and the group the units run the instances as; the group is the user's name when left out (default tarantool:tarantool)
  • --scope string - scope the application is looked for in: only system is supported
  • --unit-dir string - the directory the units are written into (default /etc/systemd/system)

tt service systemd uninstall

Remove the systemd units tt service systemd install wrote for the application, from the directory it wrote them into, and the record in <root>/etc/<APP>/systemd.yaml. The application itself is not needed. Units that are not installed are no failure: there is nothing to remove. An instance that runs under its unit is an error: stop the units first, with systemctl disable --now. A file tt did not write is left in place.

Usage

tt service systemd uninstall <APP> [flags]

Flags

  • --scope string - scope the application is looked for in: only system is supported