Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #5217

Closed
Open
Created Sep 29, 2013 by Administrator@rootOwner

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

  1. The init script should fail gracefully (display error)
  2. 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

Assignee
Assign to
Time tracking