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

Closed
Open
Created Jun 01, 2012 by Administrator@rootOwner

Change lockfile path to <installdir>/tmp, or specify full path in config/gitlab.yml

Created by: foglcz

Hi all! First of all, gitlab is awesome. However, I've ran across a problem when using multiple gitlabs installations on single unix server, when those installations both have different usernames/groups. Using apache /w passenger.

== My use case: == install first client:

  1. install gitolite into /var/git/first, install gitlab into /var/www/test.com/first (will run under first.test.com)
  2. chown first:first-gitlab /var/git/first -R
  3. chown first-gitlab:first-gitlab /var/www/test.com/first -R
  4. usermod apache -a -G first-gitlab

install second client:

  1. install gitolite into /var/git/second, install gitlab into /var/www/test.com/second (will run under second.test.com)
  2. chown second:second-gitlab /var/git/second -R
  3. chown second-gitlab:second-gitlab /var/www/test.com/second -R
  4. usermod apache -a -G second-gitlab

Then create project in first.test.com -- everything works. Then try to create project in second.test.com -- the app cannot gain access to gitolite system.

== Reason: == Whichever application has been first activated (eg. created a project), has created /tmp/gitlabhq-gitolite.lock file. That file is owned by first-gitlab user & group. Hence, the second application (which has different access rights) cannot access that lockfile. This applies to all subsequent installations as well.

== Temporary solution == I've solved the issue on my server by manually editing lib/gitlab/gitolite.rb (eg. /var/www/test.com/first/lib/gitlab/gitolite.rb ) on line 37, manually changing the filename of the lockfile, so that individual installations will use individual lockfiles.

== Proposed solution == As i'm not a ruby developer, I might have overlooked something. If so, I'm sorry for that.

I would propose to use installation tmp folder - not the global tmp folder. All gitlabs properly created tmp/cache inside of the installation dir (= /var/www/test.com/first/tmp/cache) for assets, however the locking mechanism is using global system tmp (= /tmp) folder.

Second solution would be to manually specify the full path to the lockfile, in config/githost.yml file.

(note for the multihost setup i am using -- every gitolite's installation is using different username; hence first is using git://[email protected] and second is using git://[email protected] etc.)

Assignee
Assign to
Time tracking