6-1-stable init scripts fail silently
Created by: spuder
See the following stackoverflow page for background information http://unix.stackexchange.com/questions/92783/how-to-update-an-init-script
Unless you start the init scripts as the git user, then the scripts will fail silently.
Steps to reproduce:
Install gitlab 6-1 Run the following command
root@gitlab:/etc/init.d# bash -x /etc/init.d/gitlab start
Observed behavior: No output will be returned and the gitlab service will fail to start
Expected behavior: The script should print why it failed.
Additional information:
Figured this out by running bash -x. It appears that root !=git so the script exits.
unless you use bash -x
+ RAILS_ENV=production
+ app_root=/home/git/gitlab
+ app_user=git
+ unicorn_conf=/home/git/gitlab/config/unicorn.rb
+ pid_path=/home/git/gitlab/tmp/pids
+ socket_path=/home/git/gitlab/tmp/sockets
+ web_server_pid_path=/home/git/gitlab/tmp/pids/unicorn.pid
+ sidekiq_pid_path=/home/git/gitlab/tmp/pids/sidekiq.pid
+ '[' root '!=' git ']'
+ sudo -u git -H -i /etc/init.d/gitlab start
+ exit
Steps to resolve
- The init script should fail gracefully (display error)
- The documentation should clarify how to configure the script to only run as root
I will submit a pull request to address number 1, but I am not sure how to properly resolve number 2