summaryrefslogtreecommitdiff
path: root/databases/tarantool/files/patch-extra_dist_tarantoolctl
blob: 509da0634cfdb4b3e86502df64700af27d9fdd08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- extra/dist/tarantoolctl.orig	2015-07-07 14:38:20 UTC
+++ extra/dist/tarantoolctl
@@ -39,6 +39,7 @@ The file contains common default instanc
         logger      =   "/var/log/tarantool",
 
         username    =   "tarantool",
+        groupname   =   "tarantool",
     }
 
     instance_dir = "/etc/tarantool/instances.enabled"
@@ -259,7 +260,8 @@ function load_default_file(default_file)
 
     if not usermode then
         -- change user name only if not running locally
-        d.username = d.username and d.username or "tarantool"
+        d.username  = d.username  and d.username  or "tarantool"
+        d.groupname = d.groupname and d.groupname or "tarantool"
         --
         -- instance_dir must be set in the defaults file,
         -- but don't try to set it to the  global instance dir
@@ -310,9 +312,9 @@ local function mkdir(dirname)
         os.exit(-1)
     end
 
-    if not usermode and not fio.chown(dirname, default_cfg.username, default_cfg.username) then
+    if not usermode and not fio.chown(dirname, default_cfg.username, default_cfg.groupname) then
         log.error("Can't chown(%s, %s, %s): %s",
-            default_cfg.username, default_cfg.username, dirname, errno.strerror())
+            default_cfg.username, default_cfg.groupname, dirname, errno.strerror())
     end
 end
 
@@ -367,8 +369,9 @@ local function wrapper_cfg(cfg)
     --
     -- force these startup options
     --
-    cfg.pid_file = default_cfg.pid_file
-    cfg.username = default_cfg.username
+    cfg.pid_file  = default_cfg.pid_file
+    cfg.username  = default_cfg.username
+    cfg.groupname = default_cfg.groupname
     if cfg.background == nil then
         cfg.background = true
     end