【问题标题】:Starting Gitlab with init.d script (gentoo)使用 init.d 脚本启动 Gitlab (gentoo)
【发布时间】:2013-06-30 10:21:57
【问题描述】:

我使用本指南为用户 gitlab (rvm ruby​​ python) 创建了 ruby​​ 环境: http://wiki.gentoo.org/wiki/GitLab

猫 /etc/init.d/gitlab

GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab

depend() {
        need net redis
}

start() {
        ebegin "Starting gitlab unicorn server"
    start-stop-daemon --start \
            --chdir "${GITLAB_BASE}" \
            --user "${GITLAB_USER}" \
            --pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid" \
            --exec bundle -- exec unicorn_rails -c "${GITLAB_BASE}/config/unicorn.rb" -E                     production -D
    eend $?
    ebegin "Starting gitlab sidekiq"
    start-stop-daemon --start \
            --chdir "${GITLAB_BASE}" \
            --user "${GITLAB_USER}" \
            --pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid" \
            --exec bundle -- exec rake sidekiq:start RAILS_ENV=production
    eend $?
}

stop() {
    ebegin "Stopping gitlab sidekiq"
    start-stop-daemon --stop \
            --chdir "${GITLAB_BASE}" \
            --user "${GITLAB_USER}" \
            --pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid"
    eend $?
    ebegin "Stopping gitlab unicorn server"
    start-stop-daemon --stop \
            --chdir "${GITLAB_BASE}" \
            --user "${GITLAB_USER}" \
            --pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid"
    eend $?
}%                                                                        

当我启动它时,我看到了:

 * Starting gitlab unicorn server ...
 * start-stop-daemon: bundle does not exist                                                                                                                                                          
 * Starting gitlab sidekiq ...
 * start-stop-daemon: bundle does not exist                                                                                                                                                          
 * ERROR: gitlab failed to start

我有用户 gitlab 的捆绑包。我做错了什么?

【问题讨论】:

    标签: bundle gitlab gentoo


    【解决方案1】:

    这里有两个问题。首先,rvm 通常只由用户的 shell 加载,并且这里不调用该 shell。其次, bundle 也不会在 PATH 中。要解决这两个问题,假设这是每个用户的 rvm 安装,试试这个...

    ... --exec /home/gitlab/.rvm/bin/rvm -- default do bundle exec ...
    

    附带说明,您不应将 unicorn_rails 与 Rails 3 应用程序一起使用。只需使用普通的独角兽。

    【讨论】:

      【解决方案2】:

      另外,将GITLAB_BASE=/home/gitlab/gitlab 更改为GITLAB_BASE=/home/git/gitlab。这个初始化脚本来自 GitLab 4.2。在 5.0 之后,用户从 gitlab 更改为 git。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-04-07
        • 2014-04-13
        • 1970-01-01
        • 2016-05-10
        • 1970-01-01
        • 2011-12-19
        • 2013-02-08
        • 1970-01-01
        相关资源
        最近更新 更多