Commit 6daa97f47212d89bfa0dcbb7f549ecb68d1b3783
1 parent
b27bd2b1
Exists in
spb-stable
and in
3 other branches
Changed sudo by su -c
The sudo command needs a tty to run. If you put this file on a CentOS 6, for example, it will not run in the host startup process. Instead, the 'su -c' runs the command apart if it has or not a tty. I tested this change in a fresh install of gitlab on a CentOS 6.5 with successful.
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/support/init.d/gitlab
... | ... | @@ -41,7 +41,7 @@ test -f /etc/default/gitlab && . /etc/default/gitlab |
41 | 41 | |
42 | 42 | # Switch to the app_user if it is not he/she who is running the script. |
43 | 43 | if [ "$USER" != "$app_user" ]; then |
44 | - sudo -u "$app_user" -H -i $0 "$@"; exit; | |
44 | + eval su - "$app_user" -c $(echo \")$0 "$@"$(echo \"); exit; | |
45 | 45 | fi |
46 | 46 | |
47 | 47 | # Switch to the gitlab path, exit on failure. | ... | ... |