gitlab.default.example not effect for gitaly_dir and gitaly_pid_path
Summary
The gitlab.default.example not effect for gitaly_dir and gitaly_pid_path.
Therefore, if $app_user was changed in /etc/default/gitlab , $gitaly_dir and $gitaly_pid still original value. Gittaly process cannot start.
Steps to reproduce
- Install gitlab from the source in a location other than /home/git such as /home/gitlab.
- Change $app_user to "gitlab" on /etc/default/gitlab.
- Start gitlab by systemctl start gitlab.
What is the current bug behavior?
Gitaly cannot start.
$ systemctl status -l gitlab
● gitlab.service - LSB: GitLab git repository management
Loaded: loaded (/etc/init.d/gitlab; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-04-27 15:34:00 JST; 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 26420 ExecStart=/etc/init.d/gitlab start (code=exited, status=1/FAILU
CPU: 28ms
Apr 28 15:33:28 mirara gitlab[26420]: The Unicorn web server already running wit
Apr 28 15:33:28 mirara gitlab[26420]: The Sidekiq job dispatcher is already runn
Apr 28 15:33:28 mirara gitlab[26420]: The GitLab Workhorse is already running wi
Apr 28 15:33:28 mirara gitlab[26420]: The MailRoom email processor is already ru
Apr 28 15:34:00 mirara gitlab[26420]: ..............................Waited 30s f
Apr 28 15:34:00 mirara systemd[1]: gitlab.service: Control process exited, code=
What is the expected correct behavior?
Gitaly starts normally.
Relevant logs and/or screenshots
$HOME/gitlab/log/gitlay.log
/home/gitlab/gitlab/bin/daemon_with_pidfile:16:in `initialize': No such file or directory @ rb_sysopen - /home/git/gitlab/tmp/pids/gitaly.pid (Errno::ENOENT)
from /home/gitlab/gitlab/bin/daemon_with_pidfile:16:in `open'
from /home/gitlab/gitlab/bin/daemon_with_pidfile:16:in `main'
from /home/gitlab/gitlab/bin/daemon_with_pidfile:33:in `<main>'
/home/gitlab/gitlab/bin/daemon_with_pidfile:25:in `exec': No such file or directory - /gitaly (Errno::ENOENT)
Output of checks
This bug happens on my server.
Results of GitLab environment info
$ bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System: Debian 9.0
Current User: gitlab
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.5.2
Bundler Version:1.13.6
Rake Version: 10.5.0
Redis Version: 3.2.6
Git Version: 2.11.0
Sidekiq Version:4.2.7
GitLab information
Version: 9.1.1
Revision: d3123f67f1
Directory: /home/gitlab/gitlab
DB Adapter: mysql2
URL: https://gitlab.on-o.com
HTTP Clone URL: https://gitlab.on-o.com/some-group/some-project.git
SSH Clone URL: gitlab@gitlab.on-o.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: github, bitbucket, gitlab, google_oauth2, facebook, twitter
GitLab Shell
Version: 5.0.2
Repository storage paths:
- default: /home/gitlab/repositories
Hooks: /home/gitlab/gitlab-shell/hooks
Git: /usr/bin/git
Results of GitLab application Check
$ bundle exec rake gitlab:check RAILS_ENV=production
Checking GitLab Shell ...
GitLab Shell version >= 5.0.2 ? ... OK (5.0.2)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by gitlab:gitlab?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
Takuya Ono / Test On Gitlab ... ok
Running /home/gitlab/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /home/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
Takuya Ono / Test On Gitlab ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/usr/bin/git"
Git version >= 2.7.3 ? ... yes (2.11.0)
Active users: 2
Checking GitLab ... Finished
Possible fixes
Add gitaly_dir and gitaly_pid_path on gitlab.default.example.
diff --git a/lib/support/init.d/gitlab.default.example b/lib/support/init.d/gitlab.default.example
index 9472c3c992..b341b5a030 100644
--- a/lib/support/init.d/gitlab.default.example
+++ b/lib/support/init.d/gitlab.default.example
@@ -87,4 +87,6 @@ shell_path="/bin/bash"
# This variable controls whether the init script starts/stops Gitaly
gitaly_enabled=false
+gitaly_dir=$(cd $app_root/../gitaly 2> /dev/null && pwd)
+gitaly_pid_path="$pid_path/gitaly.pid"
gitaly_log="$app_root/log/gitaly.log"
/label ~bug