Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
8852434e
Commit
8852434e
authored
10 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/gh-652-non_def_path'
parents
23ca6939
2f2b5852
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extra/dist/tarantoolctl
+38
-4
38 additions, 4 deletions
extra/dist/tarantoolctl
with
38 additions
and
4 deletions
extra/dist/tarantoolctl
+
38
−
4
View file @
8852434e
...
...
@@ -106,6 +106,27 @@ local fiber = require 'fiber'
ffi
.
cdef
[[ int kill(int pid, int sig); ]]
configs
=
{
system
=
nil
,
user
=
os.getenv
(
'HOME'
)
..
'/.config/tarantool/tarantool'
,
}
if
not
fio
.
stat
(
configs
.
user
)
then
configs
.
user
=
nil
end
config_list
=
{
'/etc/sysconfig/tarantool'
,
'/etc/default/tarantool'
,
'/usr/local/etc/tarantool/tarantool'
,
}
for
_
,
c
in
pairs
(
config_list
)
do
if
fio
.
stat
(
c
)
then
configs
.
system
=
c
break
end
end
local
available_commands
=
{
'start'
,
...
...
@@ -119,6 +140,9 @@ local available_commands = {
local
function
usage
()
log
.
error
(
"Usage: %s {%s} instance_name"
,
arg
[
0
],
table.concat
(
available_commands
,
'|'
))
for
c
,
f
in
pairs
(
configs
)
do
log
.
error
(
"Config [%6s]: %s"
,
c
,
f
)
end
os.exit
(
1
)
end
...
...
@@ -164,10 +188,19 @@ end
shift_argv
(
arg
,
0
,
2
)
if
fio
.
stat
(
'/etc/sysconfig/tarantool'
)
then
dofile
(
'/etc/sysconfig/tarantool'
)
elseif
fio
.
stat
(
'/etc/default/tarantool'
)
then
dofile
(
'/etc/default/tarantool'
)
local
instance_lua
=
nil
for
_
,
c
in
pairs
({
'user'
,
'system'
})
do
dofile
(
configs
[
c
])
if
instance_dir
then
instance_lua
=
fio
.
pathjoin
(
instance_dir
,
instance
..
'.lua'
)
if
fio
.
stat
(
instance_lua
)
then
log
.
info
(
'Found %s.lua in %s'
,
instance
,
instance_dir
)
break
end
end
instance_dir
=
nil
instance_lua
=
nil
end
if
default_cfg
==
nil
then
...
...
@@ -176,6 +209,7 @@ end
if
instance_dir
==
nil
then
instance_dir
=
'/etc/tarantool/instances.enabled'
instance_lua
=
fio
.
pathjoin
(
instance_dir
,
instance
..
'.lua'
)
end
default_cfg
.
pid_file
=
default_cfg
.
pid_file
and
default_cfg
.
pid_file
or
"/var/run/tarantool"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment