Description
Related dev. issue(s): tarantool/tarantool#7714
Product: Tarantool
Since: 2.11
Root document: https://www.tarantool.io/en/doc/latest/book/admin/instance_config/
SME: @ Totktonada
Details
A script file or a module may be specified in the TT_PRELOAD
environment variable to load before the main script. For example:
$ TT_PRELOAD=/path/to/foo.lua tarantool main.lua
The foo.lua
script will be executed before main.lua
.
$ TT_PRELOAD=foo.bar.baz tarantool main.lua
The foo.bar.baz
module will be loaded before executing main.lua
.
A value that ends with .lua
is considered as a script file, otherwise
it is considered as a module name.
Several files or modules may be passed as a semicolon separated list:
$ TT_PRELOAD="/path/to/foo.lua;foo.bar.baz" tarantool main.lua
Don't forget quotes, a shell interprets a semicolon on its own.
Redundant (duplicated, leading, trailing) semicolons are ignored.
If something goes wrong at script/module execution, tarantool reports
the problem and exits.
A script receives a path to the file in ...
, a module gets the module
name. arg
is the same as for the main script.
Requested by @ Totktonada in tarantool/tarantool@435e5ef.