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
55e9e669
Commit
55e9e669
authored
9 years ago
by
Sulverus
Browse files
Options
Downloads
Plain Diff
Merge branch 'gh-918' into 1.6
parents
579cd3bf
e8f64955
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extra/dist/tarantoolctl
+30
-3
30 additions, 3 deletions
extra/dist/tarantoolctl
src/box/lua/load_cfg.lua
+1
-1
1 addition, 1 deletion
src/box/lua/load_cfg.lua
with
31 additions
and
4 deletions
extra/dist/tarantoolctl
+
30
−
3
View file @
55e9e669
...
...
@@ -106,7 +106,27 @@ local fiber = require 'fiber'
local
digest
=
require
'digest'
local
urilib
=
require
'uri'
ffi
.
cdef
[[ int kill(int pid, int sig); ]]
ffi
.
cdef
[[
int kill(int pid, int sig);
struct passwd {
char *pw_name; /* username */
char *pw_passwd; /* user password */
int pw_uid; /* user ID */
int pw_gid; /* group ID */
char *pw_gecos; /* user information */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
};
struct group{
char *gr_name;
char *gr_passwd;
int gr_gid;
char **gr_mem;
};
struct passwd *getpwnam(const char *name);
struct group *getgrgid(int gid);
int strlen(char*);
]]
local
available_commands
=
{
'start'
,
...
...
@@ -236,6 +256,7 @@ end
-- System-wide default file may be missing, this is OK,
-- we'll assume built-in defaults
--
local
group_name
function
load_default_file
(
default_file
)
if
default_file
then
dofile
(
default_file
)
...
...
@@ -268,6 +289,12 @@ function load_default_file(default_file)
if
not
instance_dir
then
instance_dir
=
'/etc/tarantool/instances.enabled'
end
-- get user data
local
user_data
=
ffi
.
C
.
getpwnam
(
ffi
.
cast
(
'const char*'
,
d
.
username
))
-- get group data
local
group
=
ffi
.
C
.
getgrgid
(
user_data
.
pw_gid
)
group_name
=
ffi
.
string
(
group
.
gr_name
,
ffi
.
C
.
strlen
(
group
.
gr_name
))
end
if
instance_dir
==
nil
then
...
...
@@ -310,9 +337,9 @@ local function mkdir(dirname)
os.exit
(
-
1
)
end
if
not
usermode
and
not
fio
.
chown
(
dirname
,
default_cfg
.
username
,
default_cfg
.
user
name
)
then
if
not
usermode
and
not
fio
.
chown
(
dirname
,
default_cfg
.
username
,
group_
name
)
then
log
.
error
(
"Can't chown(%s, %s, %s): %s"
,
default_cfg
.
username
,
default_cfg
.
user
name
,
dirname
,
errno
.
strerror
())
default_cfg
.
username
,
group_
name
,
dirname
,
errno
.
strerror
())
end
end
...
...
This diff is collapsed.
Click to expand it.
src/box/lua/load_cfg.lua
+
1
−
1
View file @
55e9e669
...
...
@@ -56,7 +56,7 @@ local default_cfg = {
custom_proc_title
=
nil
,
pid_file
=
nil
,
background
=
false
,
username
=
nil
,
username
=
nil
,
coredump
=
false
,
-- snapshot_daemon
...
...
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