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
  • #4837

Closed
Open
Created Aug 21, 2013 by Administrator@rootOwner

rvm & startup script

Created by: drutalj

I'm playing with rvm and gitlab and i installed it successfully, almost :) The problem is init.d script:

:/etc/init.d/gitlab start
bash: bundle: command not found
GitLab service started

So, I putted the line:

source /home/rubyrvm/.rvm/scripts/rvm

somewhere at the beginning of the script, and now I have:

:/etc/init.d/gitlab start
bash: bundle: command not found
GitLab service started

When I change the line:

execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"

to

RAILS_ENV=production bundle exec puma $DAEMON_OPTS

i get:

:/etc/init.d/gitlab start
Puma starting in single mode...
* Version 2.3.1, codename: Delicious Thin Mints
* Min threads: 0, max threads: 16
* Environment: production
* Listening on unix:///home/git/gitlab/tmp/sockets/gitlab.socket
* Daemonizing...
GitLab service started

but when I check:

:source /home/rubyrvm/.rvm/scripts/rvm
:bundle exec rake gitlab:check RAILS_ENV=production

I get:

Running? ... no
  Try fixing it:
  sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  see log/sidekiq.log for possible errors
  Please fix the error above and rerun the checks.

When I execute:

:source /home/rubyrvm/.rvm/scripts/rvm
:bundle exec rake sidekiq:start RAILS_ENV=production
:bundle exec rake gitlab:check RAILS_ENV=production

I get:

Running? ... yes

How can I change init.d script to work properly? Is the script which uses

bundle exec rake sidekiq:start RAILS_ENV=production

and

bundle exec rake sidekiq:stop RAILS_ENV=production

completely wrong? Something like this:

#!/bin/sh
if [[ -z "$1" ]] ; then
        echo "Usage: gitlab {start|stop|restart}"
        exit
fi
if [[ "$1" = "restart" ]] ; then
        /etc/init.d/gitlab stop
        /etc/init.d/gitlab start
        exit
fi
source /home/rubyrvm/.rvm/scripts/rvm
if [[ "$1" = "start" ]] ; then
        echo "Starting..."
        cd /home/git/gitlab
        bundle exec rake sidekiq:start RAILS_ENV=production
        exit
fi
if [[ "$1" = "stop" ]] ; then
        echo "Stoping..."
        cd /home/git/gitlab
        bundle exec rake sidekiq:stop RAILS_ENV=production
        exit
fi
Assignee
Assign to
Time tracking