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
  • Merge requests
  • !5960

Closed
Created Dec 30, 2013 by Administrator@rootOwner
  • Report abuse
Report abuse

Switch from using a global sudo to su calls per-rake

  • Overview 3
  • Commits 1
  • Changes 1

Created by: ghost

The initial sudo fails from non-tty, and is not best practice. This switches to su for the calls needing the gitlab environment.

Not all servers have sudo. They should, but not all do. Thus init.d scripts typically use su instead when feasible. sudo by default does not allow execution (even as root) without a tty, thus the gitlab script broke down when not manually invoked (via Puppet or on boot, for instance).

I was unable to emulate the initial call to sudo (basically rerunning the script as git user) with su, although it might be possible with some work. Instead I switched to wrapping individual rake calls with su. File removals could also be wrapped in a similar fashion if there is some security concern (there should not be).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: master-5960