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
6bfdb588
Commit
6bfdb588
authored
10 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
tarantoolctl: recognize -w startup option
Recognize -w --wrapper, and don't daemonize if run from a wrapper.
parent
6a41f227
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/dist.lua
+22
-9
22 additions, 9 deletions
extra/dist/dist.lua
with
22 additions
and
9 deletions
extra/dist/dist.lua
+
22
−
9
View file @
6bfdb588
...
...
@@ -117,14 +117,33 @@ local available_commands = {
}
local
function
usage
()
log
.
error
(
"Usage: %s {%s} instance_name"
,
log
.
error
(
"Usage: %s
[-w]
{%s} instance_name"
,
arg
[
0
],
table.concat
(
available_commands
,
'|'
))
os.exit
(
1
)
end
-- shift argv to remove 'tarantoolctl' from arg[0]
local
function
shift_argv
(
arg
,
argno
,
argcount
)
for
i
=
argno
,
128
do
arg
[
i
]
=
arg
[
i
+
argcount
]
if
arg
[
i
]
==
nil
then
break
end
end
end
local
cmd
=
arg
[
1
]
-- whether or not this is run from a wrapper which takes
-- will daemonize for us
local
wrapper
=
false
if
cmd
==
'-w'
or
cmd
==
'--wrapper'
then
wrapper
=
true
shift_argv
(
arg
,
1
,
1
)
cmd
=
arg
[
1
]
end
local
valid_cmd
=
false
for
_
,
vcmd
in
pairs
(
available_commands
)
do
if
cmd
==
vcmd
then
...
...
@@ -153,13 +172,7 @@ else
instance
=
fio
.
basename
(
arg
[
2
],
'.lua'
)
end
-- shift argv to remove 'tarantoolctl' from arg[0]
for
i
=
0
,
128
do
arg
[
i
]
=
arg
[
i
+
2
]
if
arg
[
i
]
==
nil
then
break
end
end
shift_argv
(
arg
,
0
,
2
)
if
fio
.
stat
(
'/etc/sysconfig/tarantool'
)
then
dofile
(
'/etc/sysconfig/tarantool'
)
...
...
@@ -234,7 +247,7 @@ end
local
force_cfg
=
{
pid_file
=
default_cfg
.
pid_file
,
username
=
default_cfg
.
username
,
background
=
true
,
background
=
wrapper
~=
true
,
custom_proc_title
=
instance
}
...
...
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