首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用init.d脚本启动Gitlab (gentoo)

使用init.d脚本启动Gitlab (gentoo)
EN

Stack Overflow用户
提问于 2013-07-03 05:13:23
回答 2查看 1.2K关注 0票数 1

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

cat /etc/init.d/gitlab

代码语言:javascript
复制
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 $?
}%                                                                        

当我开始它的时候,我看到:

代码语言:javascript
复制
 * 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的捆绑包。我哪里做错了?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-07-03 06:05:14

这里有两个问题。首先,rvm通常只由用户的shell加载,并且此处不会调用该shell。其次,bundle也不会在路径中。要解决这两个问题,假设这是针对每个用户的rvm安装,请尝试执行以下操作...

代码语言:javascript
复制
... --exec /home/gitlab/.rvm/bin/rvm -- default do bundle exec ...

顺便说一下,你不应该在Rails3应用程序中使用unicorn_rails。只需使用普通的独角兽。

票数 3
EN

Stack Overflow用户

发布于 2013-07-04 20:20:46

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17435943

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档